Now my question is like, my game is a single player game but I can't use LocalPlayer in the script of the onTouch part, so how can I get to the playergui? I mean how can I get to the player in "players"?
✓ ANSWER ACCEPTED
How do I find player In "Players"?
1 answer
✓ Accepted answer
Hey I got the answer you need to put the script in the main areas such as Serverscriptservice,Startergui or starterplayerscripts. So I would recommend putting the script in server script service.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Wait, onTouched can work even when the script is not in the part?
There is obviously more than one way to get a player from the server.
Yes it can.
I love you Thx