So I'm trying to get this one brick to turn red once its been touched 4 times but I can't seem to get it to work.
This script is inside the actual brick itself.
i = 0
function touch(hit)
i = i+1
end
script.Parent.Touched:connect(touch)
while i < 5 do
wait(.5)
if i == 4 then
script.Parent.BrickColor = BrickColor.new("Bright red")
print("Red")
else
print("Not Red")
end
end

1 comment
That worked! Thank you so much.