You can write your topic however you want, but you need to answer these questions:
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.
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.
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.
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.
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.
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