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

Help with a 'for' loop?

Asked by 10 years ago

Hello! So I have this brick. I want 4 people to be able to go through it, then it's CanCollide becomes false, so nobody else can get through. It doesn't appear to be doing anything... I went through it like 20 times.

01for i = 1, 4 do
02    function onTouched(hit)
03        script.Parent.Transparency = .5
04        wait(.3)
05        script.Parent.Transparency = 0
06 
07    end
08end
09script.Parent.CanColloid = false
10 
11if (script.Parent ~= nil) and (script.Parent.className == "Part") then --Work if in a block
12    connection = script.Parent.Touched:connect(onTouched)
13end
0
'CanColloid' on line 09. Redbullusa 1580 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

CanCollide is spelled incorrectly at line 09.

Ad

Answer this question