I have not scripted in a long time and I ran across a problem im making a minigame and I kinda understand my problem I created a function that everytime I touch it it will read what I wrote under the function but I cant think of a way to make it that It only does it once a loop maybe not sure please help me out?
function ontouch()
local d = 1
if d == 1 then
function Fall()
local p = script.Parent
p.Transparency = 0.1
wait(0.5)
p.Transparency = 0.2
wait(0.5)
p.Transparency = 0.3
wait(0.5)
p.Transparency = 0.4
wait(0.5)
p.Transparency = 0.5
wait(0.5)
p.Transparency = 0.6
wait(0.5)
p.Transparency = 0.7
wait(0.5)
p.Transparency = 0.8
wait(0.5)
p.Transparency = 0.9
wait(0.5)
p.Transparency = 1
wait(0.2)
p.CanCollide = false
end
Fall()
end
d = 0
end
script.Parent.Touched:connect(ontouch)
