What do you want to achieve? A tweening double door for a SCPF group.
What is the issue? The tween is not playing, The the parts are all welded, + a primary part is set.
What solutions have you tried so far? I’ve looked on the dev forum for possible solutions, and have not found any.
local function DoubleDoorFunction()
if CS:GetTagged("DoubleDoor") then
for _,Tags in pairs(CS:GetTagged("DoubleDoor")) do
Tags:FindFirstChild("Detection").ProximityPrompt.Triggered:Connect(function(plr)
local StatusOfDoor = Tags:FindFirstChild("Open?")
-- Setting Permissions for later on
local Permissions = require(Tags:FindFirstChild("Permissions"))
local TweenInformation = TweenInfo.new(
4,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
true,
0.5)
if StatusOfDoor.Value == false then
StatusOfDoor.Value = true
if not Debounce then
Debounce = true
TweenService:Create(Tags.Door1.PrimaryPart, TweenInformation, {Orientation = Tags.Door1.Closed.Orientation}):Play()
TweenService:Create(Tags.Door2.PrimaryPart, TweenInformation, {Orientation = Tags.Door2.Closed.Orientation}):Play()
Sounds.BlastDoorOpen:Play()
Success:FireClient(plr)
Debounce = false
end
else
if not Debounce then
Debounce = true
local tween = TweenService:Create(Tags.Door1.PrimaryPart, TweenInformation, {Position = Tags.Door1.Closed.Position})
local tween2 = TweenService:Create(Tags.Door2.PrimaryPart, TweenInformation, {Position = Tags.Door2.Closed.Position})
tween:Play()
tween2:Play()
Sounds.BlastDoorOpen:Play()
Success:FireClient(plr)
Debounce = false
end
end
end)
end
end
end
local BlastDoor = CS:GetInstanceAddedSignal("BlastDoor")
local DoubleDoor = CS:GetInstanceAddedSignal("DoubleDoor")
BlastDoor:Connect(BlastDoorFunction())
DoubleDoor:Connect(DoubleDoorFunction())
From what I can tell the tweening part is fine, It is most likely something else in your script not working. An easy way to figure out the issue is to add prints after any major part of the code(if statement, event, etc.) if a print statement does not play, then you know where the issue is.
The third parameter of the tween create where you are declaring the position or the orientation, i have not seen it like that usually… normally its set with a variable starting position and then the tween moves it to the declared position in the third parameter. See the example in the API here under Tween Creation:
It looks from the tween create lines you have that it is moving the tween to the existing position of the part:
you should be setting a cframe instead of orientation or position you can use a part as the base hinge for each door then rotate the CFrame using CFrame.Angles() weld the door with no anchor to the hinge part
depends on the doors start rotation but something like
local OriginalDoorCFrame = Door.CFrame – get this on initial run there are a few way to use this
OriginalDoorCFrame * CFrame.Angles(math.rad(45), 0, 0) this would open it 45 degrees if that is the open rotation to tween back close just set back to OriginalDoorCFrame