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

How would i get the Arguments in the RemoteEvent?

Asked by
gumpy_e 22
2 years ago

Hello, I'm having this issue as im trying to get the listed Arguments of a RemoteEvent.

Im trying to add custom amounts of arguments to a RemoteEvent, it worked fine but the issue is unpacking the info. Its treated as an instance and i cant figure out how to get each argument.

Ive tried:

Table.Unpack

for i,v in pairs(...) do end

...[1]

I would appreciate it if someone could solve my issue

The code in question:

script.Parent.Instance.OnServerEvent:Connect(function(...)
    local args = table.unpack(...)
    print(args[1])
    --Instance.new(...[1])
end)

1 answer

Log in to vote
0
Answered by
LuaDLL 253 Moderation Voter
2 years ago

You could try this, i didn't test but worth a shot

local Instance = script.Parent.Instance

Instance.OnServerEvent:Connect(function(Player, ...) -- The First Argument Is The Player Which Fired The Remote
    local arguments = table.unpack(...)
    -- Do Whatever
end)
0
table.unpack doesnt work because it treats ... as an instance instead of a table gumpy_e 22 — 2y
Ad

Answer this question