How to go around making an effects system?

Hi there, i am creating an turn based RPG game and i need some help with the effects part of the game.

I want to make it so that whenever one of the characters attack, the effects that are applied to the character that gets attacked will be factored into the attack, such as a shield effect, which blocks a certain amount of damage. Currently what I have is each character is in charge of its own attack(which is decreasing the health value of the character being attacked), with a central script controlling all the characters, telling them when they can attack.

I want to know what would be the best way to accomplish this. I have thought of using module scripts, but I cant think of a way of making it work.

This is my first post on the DevForum, do inform me if I did something wrong. Thank you!

1 Like

You can have clients fire a RemoteEvent to the server. The event will carry some attack information. The server will validate such information.

After all the information is validated, you can then proceed to fire another event from the server that will instruct clients on what effects to create and display on their own machines.

Doing so will lighten the server load and allow the clients to handle all the effects. It helps keep your game at low latency.

EDIT: The server should handle all the important attributes of the game. Such as damage, stats handling, etc. The clients should have a LocalScript or ModuleScript that listen for an event fired by the server which contains information on which effect to create on the client’s machine.

1 Like

While this handles the display of the effects clients, I am still unsure of how to go about calculating the correct damage of the attack based on the character receiving the attack’s effects. For example, an effect called shield might be able to block 25% of damage but I don’t know how I would go about calculating that. Also, I would like to create effects that damage the characters every time their turn ends, such as a poison effect.

Thank you for replying though, sorry if I didn’t make it clear enough.

1 Like