I am currently trying to remake the “In Search Of Corpses” ability that the Smile item from Item Asylum has. (Yes i am aware it doesn’t originate from IA)
The way it works, Is it has a hitbox that slowly damages any players in it.
i have a good hitbox system, When a player enters the box, they are added to a list, of already hit characters, and when its stopped, that list has all its hit characters removed.
(it uses a Heartbeat function to cast the hitbox and stuff)
So in the heartbeat function, I added a task.wait, and after that wait it removes all the characters from the list, It works, But very oddly (sorry for the horrible video):
What i tried was wrapping it in a task.spawn (so it wouldnt affect anything else)
Like so:
task.spawn(function()
task.wait(0.3)
AlreadyHitParts = {}
end)
It works better, still odd (damages humanoids twice inconsistently) But i dont think having a task.spawn being created every heartbeat is a very good idea…
Any help is appreciated!