my ragdoll impact plays alot of times heres the clip
the impact script:
local torso = script.Parent.Torso
for i, v in pairs(script.Parent:GetChildren()) do
if v:IsA(“Part”) then
torso.Touched:Connect(function(h)
if not h:IsDescendantOf(script.Parent) and script.Parent.euphoria.V.Value == true then
if v.Velocity.Magnitude >13 then
if v.Velocity.Magnitude >2 then
local sou=math.random(1,6)
local s=script.Parent.im["Impact"..sou]:clone()
s.Parent=script.Parent.Torso
s.Name="Impact"
game.Debris:AddItem(s, 2)
s:Play()
end
end
end
end)
end
Any time you use a Touched event with a player you should use a Debounce – When and Why to stop it from happening a bunch of times. Basically a ‘cooldown’ like you mentioned.
local torso = script.Parent.Torso
local debounce = false
local waitingtime = 0.75
for i, v in pairs(script.Parent:GetChildren()) do
if v:IsA(“Part”) then
torso.Touched:Connect(function(h)
if not h:IsDescendantOf(script.Parent) and script.Parent.euphoria.V.Value == true then
if v.Velocity.Magnitude >13 then
if v.Velocity.Magnitude >2 then
if not debounce then
debounce = true
local sou=math.random(1,6)
local s=script.Parent.im["Impact"..sou]:clone()
s.Parent=script.Parent.Torso
s.Name="Impact"
game.Debris:AddItem(s, 2)
s:Play()
wait(waitingtime)
debounce = false
end
end
end
end
end)
end