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

How do you get local player in a normal script?

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 :)

1 comment

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.

1 answer

✓ Accepted answer

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.

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