I am trying to get a sprint key to work for console players, I thought it would be as simple as reusing the other one and changing the LeftShift to Thumbstick# But I cant get it to work, the script doesnt work and i tried looking up what the buttons are which for controllers but theres nothing showing me which buttons are which and I cant find a any script errors, any help would be nice! Thanks!
game:GetService("UserInputService").InputBegan:connect(function(input,gameprocesed)
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
for i = 1,16 do
wait()
game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView + 1.2
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed + .50
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input,gameprocesed)
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
for i = 1,16 do
wait()
game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView - 1.2
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed - .50
end
end
end)
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:connect(function()
game.Workspace.Camera.FieldOfView = 70
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
script.Disabled = true
end)

1 comment
connect is deprecated use Connect