Let's make a sprint script! In this video I will be covering TWO Methods of making a sprint script! Join my discord server if you want to contact me! :D
Social links:
👾Discord Server: / discord
🎮Roblox Profile: https://www.roblox.com/users/34873063...
🧊Roblox Group:
https://www.roblox.com/groups/1723045...
Scripts:
Easier Method:
local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
local Character = player.Character
local Humanoid = Character.Humanoid
Humanoid.WalkSpeed = 24
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
local Character = player.Character
local Humanoid = Character.Humanoid
Humanoid.WalkSpeed = 10
end
end)
Harder Method Scripts:
Local Script for hard method:
local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
game.ReplicatedStorage.Sprint:FireServer()
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
game.ReplicatedStorage.SlowDown:FireServer()
end
end)
Server Script for hard method:
game.ReplicatedStorage.Sprint.OnServerEvent:Connect(function(player)
local Character = player.Character
local Humanoid = Character.Humanoid
Humanoid.WalkSpeed = 24
end)
game.ReplicatedStorage.SlowDown.OnServerEvent:Connect(function(player)
local Character = player.Character
local Humanoid = Character.Humanoid
Humanoid.WalkSpeed = 10
end)
Note: You need to add remote events and make sure to use THEIR name.
Music Credits:
Acid Trumpet by Kevin MacLeod | https://incompetech.com/
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons: By Attribution 3.0 License
http://creativecommons.org/licenses/b...