So this is my script which slowly turns another brick known as "seed" invisible if a player steps on another part.
local seed = game.Workspace.Seed script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")then for i= 0,1,-0.01 do seed.Transparency = i wait() end end end)
It works only If I get rid of the for loop, and change it to 'seed.Transparency = 1'. Why is this? Do for loops not work with functions and 'FindFirstChild'?
You need to change your (-0.01 to 0.01) and the wait to (0.01)
finished code=
local seed = game.Workspace.Seed script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")then for i= 0,1,0.01 do seed.Transparency = i wait(0.01) end end end)
Explanation: So you were making it go up to 1, but in your 3rd argument you were making it go down basically making it useless
The 3rd argument determines if the number goes up, or down
Did this help? Make sure to accept the answer?
Does it not work? Make sure to comment what is wrong and I'll fix it!
(sorry if this is explained terribly)