How to grab player serverscript (mouseclick, gui)

Is it inherently wrong to grab the player by doing the,

local Player = script.Parent.Parent.Parent

type of grab?

If so, please let me know why, and how I could grab the player server-sided with guis.

1 Like

Yes, it is always wrong. You can never guarantee the player will be 3 ancestors away.

You don’t. You don’t use GUIs server-sided. This is horrible practice. Just imagine the delay in responsiveness lol

Use a local script for GUIs and use Players.LocalPlayer, period.

2 Likes

I knew that I was just watching an older YouTube video and was wondering if I was doing this all incorrect. And in order to talk to the server from GUI (local scripts) would be RemoteEvents, correct?

Yes, and remote functions too. Just whatever you do, don’t do something on the server the client should do, and vice versa

1 Like