Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with a 'for' loop?

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.

for i = 1, 4 do
	function onTouched(hit)
		script.Parent.Transparency = .5
		wait(.3)
		script.Parent.Transparency = 0
		
	end
end
script.Parent.CanColloid = false

if (script.Parent ~= nil) and (script.Parent.className == "Part") then --Work if in a block
	connection = script.Parent.Touched:connect(onTouched)
end

1 comment

0

'CanColloid' on line 09.

1 answer

✓ Accepted answer

CanCollide is spelled incorrectly at line 09.

This discussion is preserved as it was. New answers, comments, and votes are closed.