I have a trigger+script in a client context and a trigger+script in a sever context. I expect them to operate independently, and indeed that's what happens in multiplayer preview mode. However in singleplayer preview mode, when the triggers overlap the server trigger fires an event, causing the server script to try to access the client trigger, causing an error. Moreover I can't guard against this; just checking the 'isClientOnly' field triggers the error.
This means I can't use use triggers for both client and server logic without breaking singleplayer preview mode.
I constructed a minimal example like this:
ClientContext |- Cylinder |- Trigger |- PrintOnTrigger ServerContext |- Cylinder (pos = (200, 0, 0)) |- Trigger |- PrintOnTrigger -- PrintOnTrigger.lua script:GetCustomProperty("Trigger"):WaitForObject().beginOverlapEvent:Connect( function(a, b) print(a, b, script.isServerOnly) end ) Task.Spawn(function() script.parent:SetPosition(Vector3.New(0, 0, 0)) end)