I'm trying to transfer a table through a function using arguments, but it says "22:51:19.339 - Unable to cast value to Object" This error occurs on line 9 of the script
In a script in Workspace:
_G.ArrestReason={"Test"}
_G.ArrestTime={}
_G.ArrestNum={}
_G.ArrestOfficer={}
ArrestsEvent=script:WaitForChild("TransferArrests")
ArrestsEvent:FireClient(_G.ArrestReason, _G.ArrestTime, _G.ArrestNum, _G.ArrestOfficer)
In a local script:
EventHandler=game.Workspace:WaitForChild("RemoteEventHandler")
TransArrest=EventHandler:WaitForChild("TransferArrests")
TransArrest.OnClientEvent:connect(function(rsn, waitt, off, num)
print("Invoked")
print(rsn)
_G.LocalArrestReason=rsn
_G.LocalArrestTime=waitt
_G.LocalArrestOfficer=off
_G.LocalArrestNum=num
end)

8 comments
Post your code please.
Sorry forgot, but there.
I don't understand what you're trying to do with the _G table.
I'm trying to make two global tables, one on the client side and one on the server side.
Well.. the only reason you would be using remoteevents for this is if you had FE on. FE disables client to server communication. The localscript, presumable in the player, is trying to access stuff in the Workspace. Everything is cancelling eachother out so I'm still confused what your goal is lol.
LocalScripts can't access global tables that are created in server scripts...
He's trying to transfer the global table to get around that. OP, which line is in which script is causing that error?
Line 3 of the local script