Questions about RemoteEvents and RemoteFunctions [SOLVED]

I’ve already read the topic on RemoteFunctions and RemoteEvents and still don’t understand, so I am creating this post.

We already know that normal functions() can have custom vars. Something like this:

local function printAnything(message)
    print(message)
end

printAnything("Custom messages are implemented")
task.wait(1)
printAnything("Another message")

I was wondering if you could add custom vars like the message var inside RemoteFunctions or RemoteEvents so you could make them more customizable. If so, can you please tell me how?

Yep, you can!

You just pass it along with the other parameters:

RemoteEvent:FireClient(player, "Parameter1", "Parameter2", "Etc.")

You should move this Scripting support, this is the wrong category.

Whoops, was unsure on which category to put this in.

1 Like

Can you give me a more in-depth answer>

Quick search finds you the official roblox article on them…

Well, I don’t really understand how you fill in the parameters.

Yep you can. Lets say you want to do something on the server from the client. Youd have something like this then:

RemoteEvent.OnServerEvent:Connect(function(Plr,Arg) -- // The player that fired the remote event is always the first arg
	print(Plr,Arg)
end)


RemoteEvent:FireServer("Hello world!") 

Also note that you cant pass stuff such as instances as parameters through remotes (:slight_smile:

The article I sent clearly shows how to do it. Please read the article before coming back and complaining

Sorry for complaining, like I said at the top, I already had read it but I didn’t understand.

You put the parameters you want to send in the brackets

It’s fine, I got it. Thanks everyone for your help!