This question has been puzzling me for quite some time now, Can a server script access a local player?
By local player, I mean:
game:GetService("Players).LocalPlayer
Just a simple question, can a server script access that?
This question has been puzzling me for quite some time now, Can a server script access a local player?
By local player, I mean:
game:GetService("Players).LocalPlayer
Just a simple question, can a server script access that?
Well, the server is a different computer of the clients computer, so no.
A server script cannot access the local player because it is hosted on the server, not individually on each client. To understand this better, you’d have to look at the player → server networking model. You can read more about why, you can read about it here
Nope. Must be on the client. Wherever you’re trying to find the player from, there’s an alternative way that won’t break the game 0.0 Please read this. It will save you many headaches.
A server script can index that property of the player’s service, however it will always point to nil.
Yes it can, as LONG as you use remote events.
For example, in a LocalScript, you can get the variable. You can create a remote event and put the player var in as a parameter.
You can then use a script which does something with the local player parameter when the thing fires. Hope this helps!