Trying to fix TweenService Door

  1. What do you want to achieve?
    I tried to make this code where if you had a specific card and used the proximity prompt, the door would go up and then come down but I really don’t know what to do. Can anyone help me?

  2. What solutions have you tried so far?
    Tried looking up videos and other stuff and the door wont go up.

local BlastDoor = script.Parent
local Player = game.Players.LocalPlayer
local TweenService = game:GetService("TweenService")


local TweenInfo = TweenInfo.new(
	2, -- Time
	Enum.EasingStyle.Linear, -- EasingStyle
	Enum.EasingDirection.Out, -- EasingDirection
	-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
	false, -- Reverses (tween will reverse once reaching it's goal)
	5 -- DelayTime
)





script.Parent.ProximityPrompt.Triggered:Connect(function(touch)
	if Player.Character:FindFirstChild("Supervisor_Card") then
		local tween = TweenService:Create(BlastDoor, TweenInfo, {Orientation = Vector3.new(0,20,0)})	
		tween:Play()
	end
end)

I can’t script well and idk how to fix it. If anyone can help, thank you!

1 Like

Is this a local script or a server script?

If it’s a local script, make it a normal script and paste this inside:

--//Services
local TweenService = game:GetService("TweenService")

--//Variables
local BlastDoor = script.Parent

--//Controls
local tweenInfo = TweenInfo.new(
	2, -- Time
	Enum.EasingStyle.Linear, -- EasingStyle
	Enum.EasingDirection.Out, -- EasingDirection
	-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
	false, -- Reverses (tween will reverse once reaching it's goal)
	5 -- DelayTime
)

--//Functions
BlastDoor.ProximityPrompt.Triggered:Connect(function(player)
	local character = player.Character
	local supervisorCard = character and character:FindFirstChild("Supervior_Card")
	
	if supervisorCard then
		local doorTween = TweenService:Create(BlastDoor, tweenInfo, {
			CFrame = BlastDoor.CFrame * CFrame.Angles(0, math.rad(90), 0)
		})	

		doorTween:Play()
	end
end)

If it doesn’t work, if you could send me the .rbxm file of the door by right clicking it and pressing save to file, I could help out much quicker.

2 Likes