I tried making a script where i can toggle on my sprint on and off but it didn't work, is there something that i'm missing?
local player = game.Players.LocalPlayer local humanoid = player.Character.Humanoid local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftControl then humanoid.WalkSpeed = 35 end end) UIS.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftControl then humanoid.WalkSpeed = 16 end end)
Your script will change the walkspeed while the key is pressed as you set it back on InputEnded.
You can add in a walk speed check to toggle sprint and remove the InputEnded event.
Example
local player = game.Players.LocalPlayer local humanoid = player.Character.Humanoid local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftControl then if humanoid.WalkSpeed == 35 then humanoid.WalkSpeed = 16 else humanoid.WalkSpeed = 35 end end end)