Advertisement
dubleeyrblxx

Seat Animation -- Roblox

Aug 15th, 2020
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. -- Seat animation
  2. -- Put in Seat
  3. -- Make an animation in the seat and call it sitanim
  4.  
  5. seat = script.Parent
  6. function added(child)
  7.  if (child.className=="Weld") then
  8.   human = child.part1.Parent:FindFirstChild("Humanoid")
  9.   if human ~= nil then
  10.    anim = human:LoadAnimation(seat.sitanim)
  11.    anim:Play()
  12.   end
  13.   end
  14. end
  15.  
  16. function removed(child2)
  17.  if anim ~= nil then
  18.   anim:Stop()
  19.   anim:Remove()
  20.  end
  21. end
  22.  
  23. seat.ChildAdded:connect(added)
  24. seat.ChildRemoved:connect(removed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement