I’m currently using 2 scripts for a game-wide door manager (1 server, 1 local) Up until this morning, the tweening for the doors worked perfectly fine. Without anything changing, the tween suddenly stopped working for the doors. The output displays that everything went fine, but no visual changes happen.
The “CanCollide” part of the system also works perfectly fine, so I’m not sure what could be going wrong.
local UIS = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local repStorage = game:GetService("ReplicatedStorage")
local doorOpenedEvent = repStorage:WaitForChild("DoorOpened")
local sound = workspace.DoorSound
local hinge = nil
local currentCFrame = nil
local opened = nil
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 0, false, 0)
doorOpenedEvent.OnServerEvent:Connect(function(player, door, heldObject)
opened = door.Parent:FindFirstChild("Opened")
hinge = door.Parent:FindFirstChild("Hinge")
currentCFrame = door.Parent.Hinge.CFrame
if opened.Value == true then
local closeTweenPosition = tweenService:Create(hinge, tweenInfo, {CFrame = currentCFrame * CFrame.Angles(0, math.rad(-80), 0)})
closeTweenPosition:Play()
door.Parent:WaitForChild("Door").CanCollide = false
opened.Value = false
sound:Play()
task.wait(0.5)
door.Parent:WaitForChild("Door").CanCollide = true
elseif opened.Value == false then
local openTweenPosition = tweenService:Create(hinge, tweenInfo, {CFrame = currentCFrame * CFrame.Angles(0, math.rad(80), 0)})
openTweenPosition:Play()
print(openTweenPosition.PlaybackState)
door.Parent:WaitForChild("Door").CanCollide = false
opened.Value = true
sound:Play()
task.wait(0.5)
print(openTweenPosition.PlaybackState)
door.Parent:WaitForChild("Door").CanCollide = true
openTweenPosition.Completed:Connect(function(playbackState)
print("Tween completed with state:", playbackState)
if playbackState == Enum.PlaybackState.Completed then
print("Tween completed successfully")
else
print("Tween failed with error:", openTweenPosition.Status)
end
end)
end
end)
(Please excuse the messy code) If anyone could provide support, that would be greatly appreciated.