So, I put an object value into workspace,named it "player", wrote a local script that said this in it:
wait() game.Workspace.player.Value=game.Players.LocalPlayer script:Destroy() --this is to identify a local player, in a server script
and then I wrote a server script that gets that value:
game.Workspace.player.Changed:connect(function(value) player=value end) --this connects the value in the object value I made earlier, to the local player
I get this as a result:
"attempt to index global 'player' (a nil value)"
You either had the LocalScript parented wrong, or the missing local inlocal player = value
in the Script broke it. Works for me
LocalScript inside StarterGui:
wait() game.Workspace.player.Value=game.Players.LocalPlayer script:Destroy() --this is to identify a local player, in a server script
Script inside ServerScriptService:
game.Workspace.player.Changed:connect(function(value) local player = value end) --this connects the value in the object value I made earlier, to the local player