I’m trying to make a door that slides open by looping some parts in a for loop.
But for some reason the parts move to a completely different stop than the one I defined (z-axis moves to the orgin…?)
What is happening here and how do I fix this?
ServerScript:
local Click1 = script.Parent.clickdetector1.ClickDetector
local Click2 = script.Parent.clickdetector.ClickDetector
local TweenService = game:GetService("TweenService")
local Info1 = TweenInfo.new(1.8,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local Sound = script.Parent.OpenCloseDoor
local OnOff = script.Parent["on / off"]
local OnOff2 = script.Parent["on/off2"]
local Open = false
local InTween = false
local function OnClick()
if not Open and not InTween then
for i, Part in pairs(script.Parent.Folder:GetChildren()) do
TweenService:Create(Part,Info1,{Position = Vector3.new(10.741, -3,88, -74.724)}):Play()
end
Sound:Play()
OnOff.BrickColor = BrickColor.new("Lime green")
OnOff2.BrickColor = BrickColor.new("Lime green")
OnOff.Material = Enum.Material.Neon
OnOff2.Material = Enum.Material.Neon
end
end
Click1.MouseClick:Connect(OnClick)
Click2.MouseClick:Connect(OnClick)
Example of what happens: