Problems with recieving table passed through RemoteEvent

  1. I want to pass a table containing projectile arguments for my projectile handler. It contains Vector3, Integers, Strings and Instances.

  2. On recieving side, only 3 (or 5 because arguments “gravity” and the one after it are nil) arguments are recieved.

Here’s sent data:

Here’s recieved data:

  1. I tried using table.unpack and table.pack but it didn’t help

Sending to RemoteEvent:

script.Parent.Shoot:FireServer(true,{spawnPosition,angl + recoil/range,game.Workspace.Bullets,gravity,nil,bulletvelocity*bvelocitymodifier,projectile,{raycastParams.FilterDescendantsInstances,raycastParams.FilterType},range,projectiletime,bounces,gravmod,drag,bulletcolor,projectiledebristime,projectilesize,bouncesound,bouncemod})

Recieving:

script.Parent.Shoot.OnServerEvent:Connect(function(plr,visualonly,projinfo)
print(projinfo[1],projinfo[2],projinfo[3].Name,projinfo[4],projinfo[5],projinfo[6],projinfo[7],projinfo[8])
end
1 Like

Hello! It looks like you’re passing true, then the two tables. I think that’s why the bullet information is not getting sent, because its in the wrong spot from what I am understanding.

Basically you’re telling the server player, true, visualonly but you want to tell it player, visualonly, projinfo.

also I think table 2 is missing an opening {

so it should probably be this?

script.Parent.Shoot:FireServer({spawnPosition,angl + recoil/range,game.Workspace.Bullets,gravity,nil,bulletvelocity*bvelocitymodifier,projectile,{raycastParams.FilterDescendantsInstances,raycastParams.FilterType},{range,projectiletime,bounces,gravmod,drag,bulletcolor,projectiledebristime,projectilesize,bouncesound,bouncemod})

Thanks for replying! I am trying to pass player, visualonly (as a boolean - in this case: true), and a table which contains another table. When i try your solution it says “Expected ‘}’ (to close ‘{’ at column 35), got ‘)’”

For some reason, changing “nil” in projinfo table (5th value) to some other value (not nil, in my case the new value was “Exponential”) fixed it.
Sent values:


Recieved values:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.