If i have a server function, how do i get the client to run the function?
In my example, i have the GUI set up on the clients side, then in the DButton.DoClick = function() part, what should i put?
I tried putting RunConsoleCommand(“os_checkuser”) but to me it seems kinda wrong to do it like this, is there a better way?
Also, the function i want to run on the server returns true or false, how would i get the client to recieve the true or false?
Only way to send data/function calls to the server is via concommands. To send data back to the client, you can use either concommands or usermessages. But it won’t be instantaneous. You will need to freeze/disable your menu until you get the data back from the server.
What is up with me… I always seem to be the second to reply in the last few days.
The function is server only, it basically opens a file and checks for a username, but i don’t want this function being shown to the client.
Actually, say if the function was on the client, how would i call it anyway? That is also something i wanna know
Wow, so there is no way to just call a function even if it is on the same side (client) and even declared in the same file etc? Lua is funny.
Thanks for the help everyone, greatly clears things up knowing this
Ahh, Nevec that post was very useful, thanks! Lua scripts take so long to test and debug compared to Java, Visual Basic, Python etc because you need to load up Garrys Mod, it is the reason i am learning so slowly hah.