Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I fix this script so a door would open/close when I click on it?

Asked by 5 years ago

Ok, I was writing a Tween script where when you click on the door, it opens or closes depending on it's status. But the script is broken and I don't know what the problem is.

Here's the code:

01local opener =  script.Parent
02local tween = game:GetService("TweenService")
03local opened = false
04local pos = CFrame.new(30.75, 3, 141.375)
05local rot = CFrame.Angles(0, math.rad(120), 0)
06 
07local tweenInfo =  TweenInfo.new(
08    1,
09    Enum.EasingStyle.Linear,
10    Enum.EasingDirection.Out,
11    1,
12    false,
13    0
14)
15 
View all 34 lines...

1 answer

Log in to vote
0
Answered by 5 years ago

Hi! This Is How To Do It For No Collide Door:

1script.Parent.MouseButton1Click:Connect(function()
2script.Parent.CanCollode = False
3wait(5) -- Change The Time To How Long It Stays Open
4script.Parent.CanCollide = true
5end)

Working On The Opening One

Ad

Answer this question