I will try my best to be very descriptive to explain this. I am making a model, in which a player steps on a button (the soil itself) and a seed slowly becomes transparent with a for loop. After the seed is "gone", the player will step on it again and a sprout will slowly appear. Think of the common button you see in games which spawns a car. Instead of a spawn button, the goal of this model is to be an interactive garden/planter. Got that?
This is the code I tried out:
debounce = true
script.Parent.Touched:connect(function(x)
x.Parent:FindFirstChild("Humanoid")
if game.Workspace.Seed.Transparency == 0 then debounce = true
for i = 0,1,0.01 do
game.Workspace.Seed.Transparency = i
wait(0.1)
end
end
end)
if game.Workspace.Seed.Transparency == 1 then
for m = 1,0,-0.01 do --What I replaced
game.Workspace.Sprout.Transparency = m --What I replaced
end
The script doesn't do anything! It was not successful even when I replaced the small section of the code above with Print("Hello"). It also did ** not** work when I replaced it with game.Workspace.Sprout.Transparency = 0 . What is the problem? Does it not accept two for loops or what? What can I do to fix it?

1 comment
Nothing has changed, but thank you for the reminder. I could have forgotten!