Why does my animated seats only work for me in testing and not others?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I am not sure if this belongs in scripting or if it is a problem with the script but I am making animated seats for my game. :slight_smile:

  2. What is the issue?
    I have a script that I learnt from following a tutorial as I am just a beginner in scripting, it works perfectly when I am testing it in test play, but if someone else from team create test plays it does not work.

  3. What solutions have you tried so far?
    I have tried publishing it to roblox as a game, and it does still not work. Not sure if I am missing something, it’s my first time trying to make animated seats. I have also set the game to R15 and that is what I made the rigs in.

This is the script -

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)

Here is a video of it working for me in Test Play, But it does not work for others in my team create.

Where is the script located?
30 chars

scr

Located in the seat

How did you test it?
I mean, who sat first, or any errors in the output?

1 Like

This is my output
although I don’t understand most of it

local Seat = script.Parent
local Humanoid, LoadedAnimation
local Animation = Seat:WaitForChild("sitanim")

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
     if Seat.Occupant ~= nil then
         Humanoid = Seat.Occupant
         LoadedAnimation = Humanoid:LoadAnimation(Animation)
         LoadedAnimation:Play()
     else
         if LoadedAnimation then
             LoadedAnimation:Stop()
         end
         LoadedAnimation, Humanoid = nil, nil
     end
end)

Also, have you committed your changes (bottom right)? If you don’t commit them, then they will only apply locally.

1 Like

Thankyou, I am still getting the same output though, I have committed the scripts, this is what I have changed the script

local Humanoid, LoadedAnimation
local Animation = Seat:WaitForChild("sitanim")

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
     if Seat.Occupant ~= nil then
         Humanoid = Seat.Occupant
         LoadedAnimation = Humanoid:LoadAnimation(Animation)
         LoadedAnimation:Play()
     else
         if LoadedAnimation then
             LoadedAnimation:Stop()
         end
         LoadedAnimation, Humanoid = nil, nil
     end
end)

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

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

Seat.ChildAdded:connect(added)
Seat.ChildRemoved:connect(removed) ```

Does this seem right? Once again it does work for me still when I am in test play, but not for other team create users, I have tried publishing it to the game and it does not work at all even when I have committed the script. I appreciate your help.

It could be an issue with my animations I made are on my profile, they may need to be group animations for a group game, Going to try this out now

1 Like

Thankyou so much for your help, I have figured out the issue, The animations being uploaded through my profile and not the group it’s self for the group game :smiley: