Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Sending multiple variables through RemoteEvents?

Asked by
gitrog 326 Moderation Voter
6 years ago
Edited 6 years ago

The wiki makes it clear you can do this, but doesn't really explain how. I want to send three variables through a remote event. The player, an integer, and a Boolean. How exactly would I do this?

Is this the right formatting in the client? Do I have to format it any differently in the server?

--Client
playAnimationEvent:FireServer(player, fireID, true)

--Server
local function onPlayAnim(player,animId,stopPrevious)
    --do the stuff
end

playAnimationEvent.OnServerEvent:Connect(onPlayAnim)

Obviously I'm cutting out the beginning setup.

0
You do not need to define player, assuming that that is the player it is coming from. It is already defined in the :FireServer automatically. hiimgoodpack 2009 — 6y
0
Alright, thank you. Do I still need to have player in the parentheses after the onPlayAnim function? gitrog 326 — 6y
0
You're using RemoteEvents to play animations? LocalScripts automatically replicate the animations to the other player clients, I believe. Nidoxs 190 — 6y

Answer this question