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

how do I get the players character from player?

Asked by 3 years ago

basically just trying to get the players character model. this doesn't work

game.Players.PlayerAdded:connect(function(player)
    local char = player.Character
    local head = char:FindFirstChild("Head")
    head:Destroy()
end)
0
That looks about right. Does that not work? HappleMan 24 — 3y
0
I get this error. Workspace.Script:6: attempt to index nil with 'FindFirstChild' SWBTyresse 50 — 3y
0
try :WaitForChild() that should work because we are waiting for the player's character to load in Dexiber 272 — 3y

1 answer

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

if not player.Character then player.CharacterAdded:Wait() end add this before the local char line you need to wait until the character has loaded in

you can also do this repeat wait() until player.Character but it's a bad practice

and this would be even the best player.CharacterAppearanceLoaded:Wait()

Ad

Answer this question