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

How do you get local player in a normal script?

Asked by 6 years ago

I know how you get local player in a local script

game.Players.LocalPlayer

But how would you go about getting the local player in a normal script?

Thank you for your time :)

0
LocalScripts can access things like the mouse, the camera, that server scripts can't. & Server scripts can access things like DataStores, MarketPlaceService, ect. that LocalScripts can't. oSyM8V3N 429 — 6y

1 answer

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

I believe, depending on what you're trying to do, that PlayerAdded may work. Ex:

game.Players.PlayerAdded:connect(function(player)
    print(player.Name .. " has entered the game.")
end)

Now player should be the local player that had entered the game. Hope this helped a bit.

Ad

Answer this question