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 :)
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 :)
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.
1 comment
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.