i made a script that slowly turns a brick invisible but i want it to give the player money when the transparency reaches 0
here is the script:
script.Parent.MouseClick:Connect(function()
script.Parent.Parent.Transparency = script.Parent.Parent.Transparency + 0.25
if script.Parent.Parent.Transparency >= 1 then
script.Parent.Parent:Destroy()
end
end)
here is what i tried but it didnt work:
script.Parent.MouseClick:Connect(function()
script.Parent.Parent.Transparency = script.Parent.Parent.Transparency + 0.25
if script.Parent.Parent.Transparency >= 1 then
game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Money.Value + 5
script.Parent.Parent:Destroy()
end
end)
thanks

3 comments
whats the error you get back from the script?
I'll make some tests, but what I can say is that your question or script is wrong with the number.... (want when reach transparency 0 or 1?)
What kind of script is it and what location is the script.