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

How to read a table after being sent via RemoteEvent?

This is the Local Script (rest of the script has been excluded mate)

local x = 0

	repeat

		x = x + 1
		wait(0.033)

	until x == 31 or Input.UserInputState == Enum.UserInputState.End
				
	local boostValue = {}
	boostValue[1] = x

game.ReplicatedStorage.Controls.TJumpUp:FireServer(boostValue)

I've sent the table through the boundary i think this is the script:

game.ReplicatedStorage.Controls.TJumpUp.OnServerEvent:Connect(function(boostValue)

		unpack(boostValue, 1, x)

end)

but it says:

Workspace.Scripts.Controls.TJumpScript:36: bad argument #1 to 'unpack' (table expected, got Object)

1 answer

✓ Accepted answer
game.ReplicatedStorage.Controls.TJumpUp.OnServerEvent:Connect(function(player,boostValue)	 
	unpack(boostValue, 1, x) 
end)

That should work, the first parameter is always gonna be the player firing the server

1 comment

0

i appreciate this very much mate!

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