How to choose one of several values in a remotefunction?

(it is possible that the title is very vague, but I don’t know how to say it).
Basically I’ve been seeing how “remote functions” work. However, there was one thing I would like to know how to do, but first I’ll just give you the script I did:

The remote function works from Server → Client

Server Script:

local function getRandomNumber()

local a = math.random(1, 10)

local b = math.random(11, 20)

return a,b


game.ReplicatedStorage.RemoteFunction.OnServerInvoke = getRandomNumber

Client Script:

while true do

local t = game.ReplicatedStorage.RemoteFunction:InvokeServer()
print(t) – print a


Regarding the client script, I would like to know if there was any way to instead of [“t” print “a”] but rather [“t” print “b”]

You can retrieve the variables first:

local a,b = aFunction()
1 Like

Wait do I have to put this in the server script?

Forget I already realized, thanks