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

Is it right way to make good effect system? Any better ways to do it?

Asked by 2 years ago
Edited 2 years ago

I'm making effect system that will work on server side. But I want to make it look good without delays. Imagine effect was made on server, but it has some delay before player sees that! It would look awful.

So I'm thinking about making it on client first, then fire to server that I want to make effect for other players, server fires to all other players to make that effect. It will make effect for local player without delays and other players will be able to also see that effect

But exploiters can abuse that to make hell out of my game so every player will have 100000 effects in second! Is it right way to make good effect system? Any better ways to do it?

1 answer

Log in to vote
1
Answered by 2 years ago

It is good practice to render effects on the client so that the server has less workload. Having the server fire to all other players is one way to do this.

You won't have to worry about exploiters if you implement sanity checks whenever a client fires a RemoteEvent to the server. For example:

local Cooldowns = {}
RemoteEvent.OnServerEvent:Connect(function(plr)
    if not table.find(Cooldowns, plr.UserId) then
        table.insert(Cooldowns, plr.UserId)
        --Fire event to all clients to tell them to make the effect
        task.wait(3)
        table.remove(Cooldowns, table.find(Cooldowns, plr.UserId))
    end
end)

In this example, a table named "Cooldowns" is created that will be filled with players who have played the effect. If a player is in the table, they are on cooldown and the server will not listen to them firing the event again. This prevents exploiters from telling the server to play an effect as many times as they want, as the server will wait until they are off cooldown.

0
I was about to Accept Answer but the thing is, how do I stop exploiters not to just spam effects, but also stop them to do it randomly to annoy players or something? ArtemVoronin0 171 — 2y
0
Alright nevermind, I'll just check if exploiter is near the thing that effect working and if he's actually having something to do this effect (for example rock hit effect when hitting with pickaxe, exploiter has to have pickaxe in his hands) ArtemVoronin0 171 — 2y
Ad

Answer this question