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

How do I make it remove the brick?

Asked by 7 years ago

I want the if part to make the brick remove.

wait(3)

Part = script.Parent

while true do
    if Part.Transparency = 0.95 then
        Part.Transparency = 1
    else
        Part.Transparency = 0.3
    end
end

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

You want to compare the part's transparency to 0.95, not assign it to 0.95. It's important to remember that = is assignment, while == is comparison. This means == will check if two values are exactly the same. This is what you want in your if statement, afterwards, you'd just destroy the part using the Destroy method.

if Part.Transparency == 0.95 then
    Part:Destroy()
end

Let me know if you have any questions.

Ad

Answer this question