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?
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.