0

# My CharacterAdded Statement is not working. What did i forget?

Asked by 7 days ago
Edited by Ziffixture 7 days ago

I have a CharacterAdded script. I assume it's something wrong with the syntax, though, I'm unsure. What have I done wrong, can anyone give me some insight?

game.Players.PlayerAdded:Connect(function(plr)
char.Humanoid.WalkSpeed = 30
end)
end)

0
:Wait() is a method of RBXScriptSignal that yields the thread until a response is received. You've mistaken it for :Connect(), which is responsible for binding a Callback to the RBXScriptConnection. Ziffixture 6443 — 7d
0
Please do not criticize yourself for a mistake borne by inexperience; nobody will get it on their first attempt, not even software engineers. Ziffixture 6443 — 7d

1
Answered by 7 days ago

Just set char to plr.Character or plr.CharacterAdded:Wait()

game.Players.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
char.Humanoid.WalkSpeed = 30
end)

game.Players.PlayerAdded:Connect(function(player)