Hello everyone,
i was making a ragdoll system and wanted to make an optimized way to have it be triggered by an attribute and then, after a duration, the ragdoll deactivates. This is a combat script, so i dont want it to be all on the attackers side, because if they left, the victim would be stuck in ragdoll forever! the best thing i’ve had so far is below, the script’s parent is a rig(hint, it doesn’t work):
while true do
repeat
task.wait()
until Humanoid:GetAttribute("IsRagdolled")
require(Module).StartRagdoll(Humanoid)
repeat
task.wait()
until tick() - Humanoid:GetAttribute("LastRagdoll") > 3
Humanoid:SetAttribute("IsRagdolled", false)
require(Module).StopRagdoll(Humanoid)
end
this is terrible. someone please tell me how to make a better version of this…