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

How can I fix this?

This is an extremely simple script and for some reason I am not able to figure out how to fix this.It doesn't work in studio solo mode where I'm testing it.Please help.

a=game.Workspace:FindFirstChild('Player1')

function alba()
a:FindFirstChild('Humanoid').WalkSpeed=12
end 

alba()

2 answers

repeat wait() until game.Workspace:FindFirstChild('Player1')
a=game.Workspace:FindFirstChild('Player1')

function alba()
a:FindFirstChild('Humanoid').WalkSpeed=12
end 

alba()

The problem with finding a character in Workspace is the script starts working before the character spawns in Workspace. So the problem with this script is that it immediatly attempts to find Player1 in workspace, which it won't. So, if we add a wait loop, it will keep delaying the script until Player1 is found in Workspace, then it will carry out the script.

Is your name actually Player1 or something else? And same with humanoid is it same as "Humanoid"

1 comment

0

When you test in studio the player name is "Player1",its default for everyone.

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