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

How would I run skills/effects locally and allow server to damage enemies?

Asked by 5 years ago

So I plan on making a game where I can attack enemies using a fireball for example. My plan currently is making the fireball in a local script and running a touched event for the fireball inside that local script. When touched itl send a remote event to the server changing the health

My only problem with this is that I feel like its unsafe as the touched event should be on the server instead of the client.

Would this way be appropriate or is there a better alternative?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

yes. That is the only way to do it in ur case. There is no better way(i can think of). However there may be unintended side effects(eg the fireball would travel at different rates on different clients, as they all have different rates of reception depending on their internet. u can only hope this difference is negligible)

0
Well actually, the client would fire to the server to shoot a fireball. If the server accepts it, itl fire to all clients to shoot a fireball for that specific player. This way the magic/skill that is used in the client would seem much more faster/smoother. Only problem is idk how to deal with the hitboxes and touched events. windstrike 27 — 5y
0
alright TheluaBanana 946 — 5y
0
but im not sure if that is more effective as compared to just firing a fireball from the server; since thats kinda what the server does TheluaBanana 946 — 5y
0
but regardless TheluaBanana 946 — 5y
View all comments (2 more)
0
ill go edit it it now TheluaBanana 946 — 5y
0
The thing is, when i run the magic skill on the server, ingame it feels super laggy due to the latency from client to server. That why i was thinking on coding the skill locally instead and letting the server handle hitboxes etc. I just dont know if this would be the best method sadly windstrike 27 — 5y
Ad

Answer this question