Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

The part should get destroyed, what is wrong with the script? [Solved]

Asked by
xsodar 19
5 years ago
Edited 5 years ago
script.Parent.ClickDetector.MouseClick:Connect(function()

    script.Parent.Transparency = script.Parent.Transparency + 0.25

    if script.Parent.Transparency == 1 then
        script.Parent:Destroy()
    end

end)

Everything works except when it comes to "if script.Parent..." It supposed to destroy the part when the transparency reaches 1.

When the part is transparent it is still there for some reason.

I hope you can understand the script ;)

Thanks

0
trying using >= 1 instead of ==1 DinozCreates 1070 — 5y
0
Try to add a debounce MaxDev_BE 55 — 5y
0
Thanks for the comments, I found the error :) xsodar 19 — 5y
0
why would a debounce matter. DinozCreates 1070 — 5y
0
please mark title as [Solved] DinozCreates 1070 — 5y

Answer this question