01 | local player = game.Players.LocalPlayer |
02 | local character = player.Character |
03 | local UIS = game:GetService( "UserInputService" ) |
04 | if not character or not character.Parent then |
05 | character = player.CharacterAdded:wait() |
06 | end |
07 | UIS.InputBegan:Connect( function (input) |
08 | if input.KeyCode = = Enum.KeyCode.F then |
09 | game.Players.PlayerAdded:Connect( function (player) |
10 | player.CharacterAdded:Connect( function (character) |
11 | character.Humanoid.WalkSpeed = 130 |
12 |
13 | end ) |
14 | end |
I tested this and it should work. if its in a Local Script in StarterGui .
1 | local player = game.Players.LocalPlayer |
2 | local character = player.Character |
3 | local UIS = game:GetService( "UserInputService" ) |
4 |
5 | UIS.InputBegan:Connect( function (input) |
6 | if input.KeyCode = = Enum.KeyCode.F then |
7 | character.Humanoid.WalkSpeed = 130 |
8 | end end ) |