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

Why is this destroy script not functioning properly? [closed]

Asked by 7 years ago

Hello, why is this script not working? It is meant to check that if a part collides, and that if the Damage bool value is true, and if the Part is not anchored, it turns lime green, fades, and then gets destroyed...

(This is for a part which rises like a flood)

When I run the script, the part rises like normal, and no parts get destroyed. I checked, there are no errors.

function onTouched(part)
    if script.Parent.Configure.Damage.Value == true then
        if part.Anchored ~= true then
            part.BrickColor = part.BrickColor.new("Lime green")
            wait(1)
            part.Transparency = 0.1
            wait(0.5)
            part.Transparency = 0.2
            wait(0.5)
            part.Transparency = 0.3
            wait(0.5)
            part.Transparency = 0.4
            wait(0.5)
            part.Transparency = 0.5
            wait(0.5)
            part:BreakJoints()
            part.Transparency = 0.6
            wait(0.5)
            part.Transparency = 0.7
            wait(0.5)
            part.Transparency = 0.8
            wait(0.5)
            part.Transparency = 0.9
            wait(0.5)
            part.Transparency = 1
            wait(0.5)
            part:Destroy()
        end
    end
end
0
Did you include the whole script in this code block above? If so, then you never even called the function. cfiredog 274 — 7y
0
Nevermind. It's fixed. WaffleSandwich1 6 — 7y

Locked by RubenKan

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?