local ts = game:GetService("TweenService")
local times = 5
local style = Enum.EasingStyle.Quad
local direction = Enum.EasingDirection.InOut
local tweenInfo = TweenInfo.new(times,style,direction)
local function openDoor(door)
local part = door:WaitForChild("hingeEnd")
local newTween = ts:Create(door,tweenInfo,{CFrame = part.CFrame})
newTween:Play()
wait(5)
newTween:Destroy()
end
local function closeDoor(door)
local part = door:WaitForChild("hingeStart")
local newTween = ts:Create(door,tweenInfo,{CFrame = part.CFrame})
newTween:Play()
wait(5)
newTween:Destroy()
end
for i,door in pairs(script.Parent:GetChildren()) do
if door:IsA("Model") then
local prompt = Instance.new("ProximityPrompt")
prompt.RequiresLineOfSight = false
prompt.Parent = door:WaitForChild("Root")
local opening = false
local opened = false
prompt.Triggered:Connect(function()
for j, seperateDoor in pairs(door:GetChildren()) do
if seperateDoor:IsA("Model") then
if not opened and not opening then
opening = true
opened = true
openDoor(seperateDoor)
opening = false
elseif opened and not opening then
opening = true
opened = false
closeDoor(door)
opening = false
else
print("door not available")
end
end
end
end)
end
end
trying to make a door opening script, but with a double door. I’ve gone through a few iterations but none even close, how would I fix the error " TweenService:Create no property named ‘CFrame’ for object ‘2’" which points at the two tween:Create lines. is there a reason this isn’t working?