I am trying to make a shift to sprint script, I put a localscript in the starter pack that on key shift down walk speed should be 25 while key shift up walkspeed should be 16.
LocalScript:
local plr = game.PLayer.LocalPlayer local uis = game:GetService("UserInputService") local character = plr.Character or plr.CharacterAdded:Wait() local humanoid = character.Humanoid or character:WaitForChild("Humanoid") local shift = Enum.KeyCode.LeftShift local Isshiftdown = uis:IskeyDown(shift) uis.InputBegan:Connect(function(Input, gameProcessedEvent) if Isshiftdown then humanoid.Walkspeed = 25 else humanoid.Walkspeed = 16 end end)
Change WalkSpeed not Walkspeed.
local plr = game.PLayer.LocalPlayer local uis = game:GetService("UserInputService") local character = plr.Character or plr.CharacterAdded:Wait() local humanoid = character.Humanoid or character:WaitForChild("Humanoid") local shift = Enum.KeyCode.LeftShift local Isshiftdown = uis:IskeyDown(shift) uis.InputBegan:Connect(function(Input, gameProcessedEvent) if Isshiftdown then humanoid.WalkSpeed = 25 else humanoid.WalkSpeed = 16 -- the error was that you misspelled it! end end)
your supposed to do 'WalkSpeed' not 'Walkspeed'