Where to put RemoteEvents that belong to a model?

Hi

I’m trying to modify a free model cannon to work with Filtering Enabled.
First step is replicating the shot on the server. My idea is to have the LocalScript fire a RemoteEvent to the server with the cannon’s muzzle position and target position.
I’d like all the functionality of the cannon to be contained in the model, so I don’t want to put the RemoteEvent in ReplicatedStorage as suggested in the wiki.

How can I make sure that the RemoteEvent is visible to both the server and client while keeping it in the model?

Objects in the Workspace are still visible to the client.

2 Likes

Thanks! Follow-up:
Currently the LocalScript for controlling the cannon is copied into the Player’s Character when they sit down in the cannon. It could be quite hard to find the RemoteEvent(s) stored in the model from the LocalScript if there are several models with the same name in Workspace. Ideas? Could I copy over the RemoteEvent as well?

What you could do is put an ObjectValue instance inside the local script and set its value to be the remote event. Then the local script can easily reference the event with something like:
local event = script.Event.Value

1 Like

Whoah that’s really nifty, thanks!
Edit: Works great : D
Image from Gyazo

Just have to conver the rest of the movement/effects now