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

How can LocalPlayer be a child of game.Players? [closed]

Asked by 5 years ago

You can get the local player by inserting this code inside a localscript:

local player = game.Players.LocalPlayer

However i dont really understand it, because when a player joins a game, the players character will become a child of Player while LocalPlayer wont. What i mean is that i cant find LocalPlayer under

game.Players
1
It's a property not a child. You can access properties too like children that way. Oh and the character is a child of the workspace and not the player instance itself. Parts won't render if they're not descendants of workspace. User#24403 69 — 5y
1
LocalPlayer is a property that references the player associated with the client. It can only be used in LocalScripts. DeceptiveCaster 3761 — 5y
0
Actually game.Players.LocalPlayer is a property... http://prntscr.com/ono2qj SurfedZ 36 — 5y
1
Thanks, and what about player.Character is it also a property of player? AndriusTheGreat 140 — 5y
0
Yes SurfedZ 36 — 5y

Locked by User#24403

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?