Apparently this only works once. Im not sure why
01 | enabled = true |
02 |
03 | function onTouched(hit) |
04 | local door 1 = script.Parent.Parent.Door 1 |
05 | local door 2 = script.Parent.Parent.Door 2 |
06 | h = hit.Parent:FindFirstChild( "Humanoid" ) |
07 | if h ~ = nil then |
08 | if not enabled then return end |
09 | enabled = false |
10 | door 1. CanCollide = false |
11 | door 2. CanCollide = false |
12 | for i = 1 , 10 do |
13 | wait() |
14 |
15 | door 1. Transparency = door 1. Transparency+. 1 |
01 | val = 0 |
02 | time = 0 |
03 | function onTouched(hit) |
04 | local door 1 = script.Parent.Parent.Door 1 |
05 | local door 2 = script.Parent.Parent.Door 2 |
06 | h = hit.Parent:FindFirstChild( "Humanoid" ) |
07 | if h ~ = nil then |
08 | val = 1 |
09 | if val = = 1 then |
10 | val = 0 |
11 | door 1. CanCollide = false |
12 | door 2. CanCollide = false |
13 | for i = 1 , 10 do |
14 | wait() |
15 |
You don't need enabled though tell in the comments if it works.
+1 if helped.
Have you tried the loop or wait?
1 | wait( 2 ) --if a function but the function there ex: Fire() |
2 | fire() |
3 | end |