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

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

Asked by 8 years ago

(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

Log in to vote
0
Answered by 8 years ago

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)
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. Glueable 20 — 8y
0
if you mean character then i just edited the answer DragonSkyye 517 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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

Answer this question