I have a lot of doors, each with a Vector3Value inside of them, being OpenPosition and ClosedPosition. I use a script to open and close it using those values, but instead it tweens them to 0,0,0? If I’m missing something, please let me know, as it is supposed to be a core mechanic.
Below is my script. Every single last door has all of the values in them.
local Tween = game:GetService("TweenService")
script.Parent.ClickDetector.MouseClick:Connect(function(Clicker)
if Clicker:GetRankInGroup(5806137) >= 230 then
for _,door in pairs(workspace.DormDoors:GetChildren()) do
if not door.isOpen.Value then
Tween:Create(door,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Position = Vector3.new(door.OpenPosition.Value)}):Play()
wait(1)
door.isOpen.Value = true
elseif door.isOpen.Value then
Tween:Create(door,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Position = Vector3.new(door.ClosedPosition.Value)}):Play()
wait(1)
door.isOpen.Value = false
end
end
end
end)