I'm trying to make it so the two sides of the doors slide to the left and right, whilst the statue goes down but at the moment, the doors slide but the statue vanishes and doesn't come back.. Any ideas on how to fix?
debounce = false
script.Parent.Touched:connect(function(hit)
if debounce == true then return end
debounce = true
if hit.Name == "Alohomora" then
for i = 1,40 do
game.Workspace.Door1.DoorA.CFrame = game.Workspace.Door1.DoorA.CFrame + Vector3.new(.50,0,0)
game.Workspace.Door1.DoorB.CFrame = game.Workspace.Door1.DoorB.CFrame + Vector3.new(-.50,0,0)
game.Workspace.Door1.Statue:MoveTo(Vector3.new(game.Workspace.Door1.Statue.MagicPoint.Position.X,game.Workspace.Door1.Statue.MagicPoint.Position.Y -.5,game.Workspace.Door1.Statue.MagicPoint.Position.Z))
wait()
end
wait(5)
for i = 1,40 do
game.Workspace.Door1.DoorA.CFrame = game.Workspace.Door1.DoorA.CFrame + Vector3.new(-.50,0,0)
game.Workspace.Door1.DoorB.CFrame = game.Workspace.Door1.DoorB.CFrame + Vector3.new(.50,0,0)
game.Workspace.Door1.Statue:MoveTo(Vector3.new(game.Workspace.Door1.Statue.MagicPoint.Position.X,game.Workspace.Door1.Statue.MagicPoint.Position.Y +.5,game.Workspace.Door1.Statue.MagicPoint.Position.Z))
wait()
end
else
end
debounce = false
end)
Thank you.

6 comments
Tweening
lerp too boi
Put a humanoid in literally everything and use the MoveTo function, I highly recommend this (sarcasm)
That is incredibly stupid.
reposition each part individually in a while loop
You cant move a model lmao ????. Make a primary part for that model and instead move the primary part CFrame and it sort of "welds" and holds the entire model (The PrimaryPart)