hi there, localscript cant get server global variable
server:
-- services
_G.GAME_servertype = "DEV"
client:
task.wait(2)
print(_G.GAME_servertype) -- this code returns nil, and i dont know why.
hi there, localscript cant get server global variable
server:
-- services
_G.GAME_servertype = "DEV"
client:
task.wait(2)
print(_G.GAME_servertype) -- this code returns nil, and i dont know why.
i’m pretty sure the client and server have different _G tables, so things in _G defined on the server aren’t replicated to clients and vice versa. You’d have to use something like a remote function to get a value from the server
hm? strange, ive heard that server global variables are accessable from client, well seems like they arent.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.