Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

animation is not firing when seat is sat in?

Asked by 3 years ago

i have an animation in a seat that replaces the sitting animation when you sit in the seat this works for me. Only me. my friend tries it and it outputs as if everything were to be working but the animation dose not play this is my script:

seat = script.Parent
function added(child)
    if (child.className=="Weld") then
        print("weld")
        local human = child.part1.Parent.Humanoid
            print("ani loading")
            anim = human:LoadAnimation(seat.Animation)
            anim:Play()
            print("ani played")

    end
end

function removed(child2)
    if anim ~= nil then
        anim:Stop()
        anim:Remove()
    end
end

seat.ChildAdded:connect(added)
seat.ChildRemoved:connect(removed)
0
You can check when the occupant of the seat is changed instead of using ChildAdded. sngnn 274 — 3y
0
Also, if your friend is testing in Studio, it may be the fact that he doesn't own the animation. sngnn 274 — 3y

Answer this question