Opening a tweenservice door if someone has a keycard

  1. What do you want to achieve?
    I have this code but idk how to make it so the door opens when you have a specific card or holding it.

  2. What solutions have you tried so far?
    I tried looking at some videos and other devforum posts but it just wont work.

Here’s the code:

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


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





BlastDoor.ProximityPrompt.Triggered:Connect(function(touch)
	local tween = TweenService:Create(BlastDoor, TweenInfo, {Position = game.Workspace.Target1.Position})	
	tween:Play()
	task.wait(0.5)
	task.wait(10)
	local tween1 = TweenService:Create(BlastDoor, TweenInfo, {Position = game.Workspace.Target2.Position})
	tween1:Play()
	task.wait(0.5)
end)

I’m not good at scripting, but if you can help then Thank You!

2 Likes

You should check your previous posts on this problem.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.