Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would i get the Arguments in the RemoteEvent?

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

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)

1 comment

0

table.unpack doesnt work because it treats ... as an instance instead of a table

This discussion is preserved as it was. New answers, comments, and votes are closed.