You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I’m trying to make a train with rig doors
-
What is the issue? Rig stuck in stopped position while trying to play a different animation.
-
What solutions have you tried so far? I tried changing the script but it didn’t work
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Script 1 (door left open)
local children = script.Parent.door:GetChildren()
-- local car1 = script.Parent.Car1.Body
-- local car2 = script.Parent.Car2.Body
-- local car3 = script.Parent.Car3.Body
-- local car4 = script.Parent.Car4.Body
-- local car5 = script.Parent.Car5.Body
-- local car6 = script.Parent.Car6.Body
for i = 1, #children do
local child = children[i]
local theW = child.Humanoid:LoadAnimation(child.dop)
if child.Name == "doorl" then
task.spawn(function()
-- car1.engine.DOd:Play()
-- car2.engine.DOd:Play()
-- car3.engine.DOd:Play()
-- car4.engine.DOd:Play()
-- car5.engine.DOd:Play()
-- car6.engine.DOd:Play()
theW:AdjustSpeed(1)
theW:Play(0)
wait(1.6)
theW:AdjustSpeed(0)
end)
end
end
Script 2 (door left close)
local children = script.Parent.door:GetChildren()
-- local car1 = script.Parent.Car1.Body
-- local car2 = script.Parent.Car2.Body
-- local car3 = script.Parent.Car3.Body
-- local car4 = script.Parent.Car4.Body
-- local car5 = script.Parent.Car5.Body
-- local car6 = script.Parent.Car6.Body
for i = 1, #children do
local child = children[i]
local theW = child.Humanoid:LoadAnimation(child.dcl)
if child.Name == "doorl" then
task.spawn(function()
theW:AdjustSpeed(1)
-- car1.engine.DCd:Play()
-- car2.engine.DCd:Play()
-- car3.engine.DCd:Play()
-- car4.engine.DCd:Play()
-- car5.engine.DCd:Play()
-- car6.engine.DCd:Play()
wait(1.4)
theW:Play()
wait(1.65)
theW:AdjustSpeed(0)
end)
end
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.