I make a part, name it “door” Anchor it, un weld it. Make a tool called Keycard then I enter this script:
script.Parent.Touched:Connect(function(hit()
if hit.Name == “Keycard” then
local goal = {}
goal.Position = door.Position + Vector3.new(0,6,0)
local Info = TweenInfo.new(1)
local tween = TweenService:Create(door, info, goal)
tween:Play()
wait(7)
local goal = {}
goal.Position = door.Position + Vector3.new(0,0,0)
local Info = TweenInfo.new(1)
local tween = TweenService:Create(door, info, goal)
tween:Play()
end
end)
end)
Is there anything wrong with this script? If so, can you help me?