Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

2 comments

0

you shouldve edited it

0

?

1 answer

✓ Accepted answer

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)

3 comments

0

u have too many ends

0

Cheers

0

Yes sorry there Corrected it

This discussion is preserved as it was. New answers, comments, and votes are closed.