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
local player = game.Players.LocalPlayer
local character = player.Character
local UIS = game:GetService("UserInputService")
    if not character or not character.Parent then
        character = player.CharacterAdded:wait()
    end
UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.F then
        game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
            character.Humanoid.WalkSpeed = 130  

    end)
end
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 .

local player = game.Players.LocalPlayer
local character = player.Character
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.F then
      character.Humanoid.WalkSpeed = 130  
 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