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

How do I find a player's entity on startup?

(First of all, I'm sorry for being a total noob to scripting, but I had a large hiccup in time and now I forgot almost everything.)

Okay, so I have this...

local Players = game:GetService("Players")

Players.PlayerAdded:connect(function(player)
	
end)

And, As stated, I have no idea how to find a player's entity (body parts, hats, Humanoid, etc.)

Is there a way to find a player just from this? thanks.

P.S. Is this suppost to be in a localscript?

2 answers

✓ Accepted answer

Your code is correct. i do not recommend using it in a localscript

Inside game.ServerScriptService or workspace you can do:


local Players = game.Players -- get Players

Players.PlayerAdded:connect(function(player) -- connect the PlayerAdded event

	Player.CharacterAdded:connect(function(character) -- Get character when Added
		print(player.Name, "character has been added")
	end)
	
	print(player.Name, "has entered the server!") -- print to output

end)

2 comments

0

That is not what I was asking, I was trying to find the entity, not what you can do with game.ServerScriptService, Sorry for any confusion.

0

if you mean character then i just edited the answer

Player.Character This line gets the workspace character eg.Legs, arms, torso ext

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