Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix this script, it should when press "F" change speedpower of the player to 130?

Asked by 4 years ago
Edited 4 years ago
01local player = game.Players.LocalPlayer
02local character = player.Character
03local UIS = game:GetService("UserInputService")
04    if not character or not character.Parent then
05        character = player.CharacterAdded:wait()
06    end
07UIS.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)
14end
0
you shouldve edited it VVoretex 146 — 4y
0
? GGredfox_GG -8 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I tested this and it should work. if its in a Local Script in StarterGui .

1local player = game.Players.LocalPlayer
2local character = player.Character
3local UIS = game:GetService("UserInputService")
4 
5UIS.InputBegan:Connect(function(input)
6    if input.KeyCode == Enum.KeyCode.F then
7      character.Humanoid.WalkSpeed = 130 
8 end end)
0
u have too many ends HappyTimIsHim 652 — 4y
0
Cheers GGredfox_GG -8 — 4y
0
Yes sorry there Corrected it sturdy2004 110 — 4y
Ad

Answer this question