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

How can I repair my sit animation script ?

Asked by 4 years ago

I wrote this script a few months ago to get the player into a pose when they sit on a seat. Now this script doesn't work anymore. How can I repair it ?

seat = script.Parent
function added(child)
    if (child.className=="Weld") then
        local human = child.part1.Parent:FindFirstChild("Humanoid")
        if human ~= nil then
            anim = human:LoadAnimation(seat.sitanim)
            anim:Play()
        end
     end
end

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

seat.ChildAdded:connect(added)
seat.ChildRemoved:connect(removed)
0
I'm quite confused with line:4, how did you get the Humanoid using Part1? rayhansatria 142 — 4y
0
I copied the script from a video back then. pinopeltzi 7 — 4y

Answer this question