I'm trying to make a part go from transparency = 0 to transparency = 1 onClicked.
For some reason it's not working, idk how to fix it.
local Part = script.Parent function onClicked(playerWhoClicked) Part.Transparency > 0 do Part.Transparency = Part.Transparency - 1 wait(1) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Any help would be greatly appreciated!
You're not using a "check" right. Use an if statement!
Here's where you did Lua wrong,
Part.Transparency > 0 do
What you should be doing is,
if Part.Transparency > 0 then
This means your code should look like this,
local Part = script.Parent function onClicked(playerWhoClicked) if Part.Transparency > 0 then Part.Transparency = Part.Transparency - 1 wait(1) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Good Luck!