Author Topic: Retrieve a value from my server(ClientSided)  (Read 410 times)

Okay so, I am working on a new project with GUIs and I want my GUIs to show specific values from the server...
By this, I mean: For exemple,

the server does: findclientbyname(Inno).bananas=17;
How could I retrieve this value from a client sided addon?

I know it would maybe ask for a serversided command like "function servercmdgetbananas(%client){return %client.bananas;}" But that's about it so... Thanks to anybody who would like to help :D

PS: I dont care if it's a long script!

In your client mod do this:
Code: [Select]
function clientCmdBananas(%var)
{
    //Do whatever with the var
}
Then server sided:
Code: [Select]
function serverCmdGetBananas(%client)
{
    commandToClient(%client, 'Bananas', %client.bananas);
}

Then whenever you want to get how many bananas you have do commandToServer('GetBananas'); and then do whatever with it in the client command.

Yeah lol I had the idea just before you posted. Thank you tho!! :cookieMonster: :cookie: