In the game im working on im trying to display a _G table value on some text, when I test I get the error “Attempt to index nil with userdata” here is my code:
while wait() do
p = game.Players.LocalPlayer
script.Parent.Text = _G.ServerData[p].Shards
end
You can do it however you wish but I would strongly recommend using a RemoteFunction because the client may take time to load in and it can then call on the server when it’s ready to receive the data.
I know with server when you InvokeServer when the server receives it you have to put player first in the (). Is there anything the same with the client, im asking because im getting the error [Argument 1 missing or nil] now
Use a remote event since you’re not returning anything. InvokeClient requires a player to invoke that’s why it didn’t work. Also pls dont use _G and use module script instead
I would use module scripts but im worried because I know sense the client can change values in them that means exploiters can mess with values, if I didnt use _G exploiters could change there coins, pets, etc