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

How do I make the sitting anims work (for vibe game)?

Asked by 3 years ago
Edited 3 years ago

Basically I'm making a vibe game, I have sit anims that are already scripted but show up in only my screen, I did a team test to check but only I could see it, my friend sent a photo of how their screen was but it showed as if it was a normal sit anim. here's the script, seat = script.Parent function added(child) if (child.className=="Weld") then 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) how do you make it a server script instead of a local?? i don't think it's the script's problem, the animation only plays for the animation creator???

1
Is your script LocalScript or Server Sript? Maybe that is the problem X_XUser360 1 — 3y
0
I believe it's a local script, I'll try it out ramenvibe 2 — 3y
0
A LocalScript will only show the animations locally, so you need to play the animation on the server. You should probably use a RemoteEvent for this. R_alatch 394 — 3y
0
How do you use a remote event?? i'm new to scripting, can you answer in the answer this question part?? ramenvibe 2 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

The best thing to do when animating for a seat would be to place a Script inside of the actual Seat you would like to use. Note the is a script and NOT a local script. After creating a script inside of the seat, place your sitting animation in the seat as well. Next inside the script copy and paste this:

seat = script.Parent
function added(child)
    if (child.className=="Weld") then
        local human 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)

If you have any questions just respond below.

Ad

Answer this question