Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When should I generally be firing events to/from the client/server?

Asked by
Ghusoc 50
5 years ago

I normally get some kind of error stating that I need to make sure I've implemented OnServerEvent or the likes, and I can only assume because I fire the event too much, an example would be:

Client A fires their weapon, and fires a RemoteEvent. The server receives the incoming data from Client A (where the tracer starts, ends, etc.) and passes it to all clients. Clients X create the tracer based on that data.

Rather than fire an event every time the weapon fires, and assuming the weapon is an automatic, could I fire when firing starts and stops - passing data such as the weapon's fire rate, etc., so the clients can then create tracers based on that?

I'm just trying to get a gist of when it's appropriate to do things like this, and whether there's some kind of rule of thumb I should follow.

0
Why would you pass the fire and rate, the client can send any arguments if you did that User#19524 175 — 5y
0
To create tracers based on the fire rate (a tracer every X second) - but I realised that I could just pull the data server-sided since I use a module full of all the weapon's statistics - that way I can just fire for when the player starts and stops firing? I don't know entirely, hence the post. Ghusoc 50 — 5y

Answer this question