hey there! at the moment, when a remote event is fired and handled on the server I am unable to return a cashier object despite it being stored in a table in a module script.
module:
Register.ClaimedRegisters = {} -- [register] = player
...
function Register.ClaimRegister(player, register)
Register.ClaimedRegisters[register] = player
end
server script:
OpenTipJarGUIEvent.OnServerEvent:Connect(function(player, tipJar)
local register = tipJar.Parent
local cashier = RegisterModule.ClaimedRegisters[register]
if cashier then
local assets = CashierTippingModule.PlayerAssets[cashier.UserId]
if assets and #assets > 0 then
OpenTipJarGUIEvent:FireClient(player, assets, cashier.Name)
end
else
print("no cashier")
end
end)
Do you really need an entire function for that, vro?
Ever heard of contexts?
Table required by modulescript on a client ~= table on a server;
Its a 2 separate non replicatable to each other entities.
I also suggest dumbing down all of it and removing the module script entirely because you essentially use it just to store a table reference.
Well firstly you need to understand what does run contextmeans.
This are essentially 2 separate entities for both server and client who have 2 separate table entities; althrough this modulescript may share same instance hash.