πŸ’¬

Community answer

Collected from the ACE community Discord archive around 2023-07-04. It may be informal or outdated β€” anyone can edit this page to improve it.

Telling client vs server code realms

πŸŒ™ LuaUpdated 2 days agoβ€’0 views
There are automatic global variables SERVER and CLIENT which are only true in their realm. Code inside 'if SERVER then ... end' runs only on the server, 'if CLI…

In GLua, how do you know whether code runs on the client or the server?

There are automatic global variables SERVER and CLIENT which are only true in their realm. Code inside 'if SERVER then ... end' runs only on the server, 'if CLIENT then ... end' only on the client, and code outside such blocks runs on both - so a function can exist in both realms.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.