Fire event to both server and client?

I have a clock that keeps time for the server. For each second that passes, the clock calls a RemoteEvent which returns the time to LocalScripts use to update the guis that display the time. However, I want other server-side scripts to be able to receive that same information for managing time-dependent data.

Right now, I just have the Timekeeper script have an attribute called Time that is updated for each second, and at the same time fires a RemoteEvent to all clients. Server-side scripts listen for the Attribute change and client-side scripts listen for the RemoteEvent.

Is there a more elegant way to do this, like a substitute for RemoteEvent that can be listened to from both the client and other server-side scripts? Thank you!

I suppose you could use GetAttributeChangedSignal (or AttributeChanged) as a replacement for the RemoveEvent. Should work with both local and server scripts.

1 Like

you could use a RemoteEvent and a BindableEvent and both fire them at the same time the bindable event from server to server and the remote event server to client.

2 Likes

You could try BindableEvents

2 Likes

Oops! Sorry, I forgot to specify that the script in question was stored in ServerScriptService and not ReplicatedStorage. This would have definitely been my best option if it wasn’t constrained by the location. <:^(

Thank you so much! I had a hard time wrapping my head around Remotes and Bindables before and it turns out they’re not as messy as I was making them. You are fantastic!