• Fetching data from server sided script to a client sided script.
    2 replies, posted
Hello, I'd like to state I'm quite new to gmod and don't have much experience, however, I do have 5 years LUA experience which shouldn't really help about this. Anyhow, I'm looking for a way to fetch data from a server sided function via a client script. Seems a bit confusing at first but the reason for this is that the data will be fetched through a database meaning I rather not have it client sided, for that matter, I don't even think that is possible. Anyhow, I'm just looking for some examples or what I need to achieve this. Example Serverside [CODE]function testFunction() local test = { {name = "TestName", steamid = "BLANK", value = "5"} } return test -- The table needs to be sent over to the client script when requested by the clientsided script end[/CODE] Example Clientside [CODE]local TestTable = testFunction() -- Calls for the table and waiting for a return for k,v in pairs(TestTable) do PlayerList:AddLine(v.name, v.steamid, v.value) end[/CODE] any ideas how to communicate or send data between server sided scripts and client sided?
[url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url]
[QUOTE=rtm516;52819309][url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url][/QUOTE] Cheers for the help bud!
Sorry, you need to Log In to post a reply to this thread.