I was trying to make a shift to sprint script for my game, where you hold left shift to sprint.
When I play test the game it doesn’t work I don’t know why does anyone see any issues?
I have tried a few different ways to make this script but none of them worked.
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(key)
if key == Enum.KeyCode.LeftShift then
game.Workspace.Camera.FieldOfView = 100
script.Parent.Parent.Character.Humanoid.WalkSpeed = 20
uis.InputEnded:Connect(function(key2)
if key2 == Enum.KeyCode.LeftShift then
game.Workspace.Camera.FieldOfView = 70
script.Parent.Parent.Character.Humanoid.WalkSpeed = 16
end
end)
end
end)
Does anyone see any problems with the script? I don’t really see any problems but that might just be me.
Here is the dev log, there is no errors in her about the script, and yes it is a local script and I did put it in StarterPlayerScripts.