(Solved) Broken animation

Hello i need help with my animation player it repeats it serval times before doing the full animation it also isn’t meant to loop but still does
WARNING THE VIDEO HAS A JUMPSCARE

local part2 = game.Workspace.Brrr
part2.Touched:Connect(function(hit)
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local hum = script.Parent:WaitForChild(“Humanoid”)
if hum then
print(“Success”)
else
print(“No Humanoid”)
end
local humanim = hum:LoadAnimation(script:FindFirstChildOfClass(“Animation”))

–Playing Animation–
if enabled.Value == true then
humanim:Play()
humanim.Looped = true
humanim:AdjustSpeed(sp.Value)
end
end)

robloxapp-20210509-2138404.wmv (739.7 KB)

local part2 = game.Workspace.Brrr
part2.Touched:Connect(function(hit)
    local set = script.Settings
    local sp = set.Speed
    local enabled = set.Enabled
    local hum = script.Parent:WaitForChild("Humanoid")
    if hum then
        print("Success")
    else
	    print("No Humanoid")
    end
    local humanim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))

    --Playing Animation--
    if enabled.Value == true then
	    humanim:Play()
	    humanim.Looped = true
	    humanim:AdjustSpeed(sp.Value)
    end 
end)

Formatted yeah

You might wanna disconnect this touched connection after the animation is being played, or not allow it to run while an animation is playing.

1 Like