So far, this is what I have, and I was wondering, How would I make a while loop that took the Transparency of b and every 0.2 seconds added 0.1 to b's Transparency after the brick is touched?
local b = script.Parent function onTouch(part) end b.Touched:connect(onTouch)
So, first, imagine solving this problem without the context of Touched.
We would do exactly what you said:
while true do -- a while loop wait(0.2) -- every 0.2 seconds local bsTransparency = b.Transparency b.Transparency = bsTransparency + 0.1 -- 0.1 added to b's Transparency end
Then we just can put this inside of our touched function:
local b = script.Parent function onTouch(part) while true do -- a while loop wait(0.2) -- every 0.2 seconds local bsTransparency = b.Transparency b.Transparency = bsTransparency + 0.1 -- 0.1 added to b's Transparency end end b.Touched:connect(onTouch)
This will more or less work. Two ideas to improve it: add a debounce and reset the transparency to 0 each time it gets touched.