What's an effective way of creating a D.O.T / Status Effect system?

So I’ve been trying to figure out a way to make a damage over time system, like setting a player on fire after being hit by a fire based weapon.

Originally, I was cloning a Fire Object to the hit players, and the Fire Object had a script inside of it that did damage to Script.Parent.Parent.Parent.Humanoid in a while loop, but recently I learned that exploiters can simply just remove the descendants of their Character, so the system I was using isn’t very effective.

Does anyone know another method I could use for a DOT effect?

4 Likes

Exploiters can’t touch server scripts, damage them over time using a loop.

local iterationsBeforeStop = 5
local timing = 1 -- pause before each damage
while true do wait(timing)
     iterationsBeforeStop += -1 -- ew why did I do that
     if iterationsBeforeStop < 1 then
          break
     end
     humanoid.Health = humanoid.Health - 10
end

Somehow you have to get the humanoid, probably using PlayerAdded. You can add the fire and even when exploiters delete them, the damage will still be done.

1 Like

Would it make a difference if I were to clone the damage script and Fire Particle Emitter to the player’s character separately, rather than just cloning the Fire Particle Emitter with the Script as it’s child? Would an exploiter be able to delete a “Script” Object that is a child of their Charater, instead of a “Part” Object?

Even if exploiters delete scripts on the server, they will still run because they are replicated to the client. The scripts even after being destroyed will run if its a server script. What kind of script do you have?

1 Like

Example Script I made right now, the scripts parent would be the Player’s Character and it is a “Script” not a “LocalScript”:

local Humanoid = Script.Parent.Humanoid
while true do 
-- Damage Stuff here to the humanoid
end 

After looking at this thread it seems that an exploiter can just straight up delete the Descendants from their Character like Value Objects such as IntValue, BoolValue, etc, but I want to know if they can delete a Script Object as well since Server Scripts are sent to the client as byte data.

If the script is a localscript, it can be edited using exploits, people can delete portions of code but if it is a server script, they have no access to the server. This being said if you delete a regular script in workspace client sided, stuff will still run.

I did a test and deleted the accessory and the Health Script of my Character on Studio through a LOCAL SCRIPT and it actually did replicate onto the Server:

On the Client before deletion

On the Client after deletion

On the Server after deletion

As you can see, even though the Health Script and Accessory were deleted locally from local script, it replicated on to the server and stops the Script from running.

Edit: This is why I am looking for a different method executing damage over time onto the hit player. Since if I set the script’s parent to the Player’s Character, the exploiter can just delete. If try and put the While loop into my weapon script, it will make the weapon script yield and wait for the while loop to finish.

The solution to this is easy! You gotta put that health script somewhere else. Anything that happens to the client’s CHARACTER will generally replicate to the server (this is why people are able to alter their WalkSpeed and JumpPower even in FilteringEnabled games, in case you were wondering.)

Putting a server script in a player’s character model is 99% of the time the very last thing you want to do. You can put it in the Workspace and deleting it from the client will not replicate. Or better yet, you can put it in ServerStorage and the client won’t even be able to see it.

Players have default network ownership over their character model, but not on their player instance (this is why it is safe to store data inside of a player’s Player instance). If OP needs storage for this script per-player (for whatever reason) he can store the damage script in their Player instance.

1 Like