|
| 23 Jun 2017 04:23 AM |
Say like I wanna get the variable "Stamina" from the server and have it sent over the client for them to read
I want the client to send a request and the server send back information and then the client can use it like
local energy = Whatevertheserversent |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:32 AM |
| I can't figure out how to get the variables to the client and read them |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:34 AM |
Try using remotefunctions
-- roblox chat syst## |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:36 AM |
But how do i use the variables on the client once I get them?
for example I wanna send Stamina and Max Stamina over to the client..
How would if possible I make it so once I get the variables
local Stamina = val1
local StaminaMax = val2 |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:42 AM |
Remote functions are used to pass information from the server to the client.
When the client invokes the server, the client script will then yield until server finishes with the invokation. The Server can then return values back to the client, for it to use.
Go to the RemoteEvents and RemoteFunctions wiki.
-- roblox chat syst## |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:45 AM |
You are not fully reading my text unless im being 100% stupid, also stop refering me back to the remotefunctions and remote events wiki please, I understand that they exist, but how do I USE the variables once I send them.
I'm have trouble grasping on how to use the sent variables once I receive them |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:48 AM |
| Actually nvm I have a workaround |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:52 AM |
local var1, var2 = remoteFunction:InvokeServer()
print(var1) print(var2) |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:53 AM |
In the server script, just make it return the values you want
-- roblox chat syst## |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 04:56 AM |
local var1, var2 = remoteFunction:InvokeServer()
print(var1) print(var2) Thank you!!! thats what I wanted the other one I understood perfectly. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2017 05:00 AM |
I was confused on what you were asking, my fault.
-- roblox chat syst## |
|
|
| Report Abuse |
|
|