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

How to Make Spleef... Again?

Asked by 10 years ago

So I got the script finally to make it dissapear in Spleef but now once the script is done it does not go to 1 transparency again. Like when I hit it, after I hit it, it does not work...

local Sp = game.Workspace.Part
local Debounce = false
Sp.Touched:connect(function(hit)
    if Debounce == false then
        Debounce = true
        for i = 1, 9 do
            wait(0.1)
            Sp.Transparency = Sp.Transparency + i/10
        end
    end
    Debounce = true
    wait(1)
    Sp.Transparency = 0
    Sp.CanCollide = false
    wait(1)
    Sp.CanCollide = true
end)

1 answer

Log in to vote
1
Answered by
war8989 35
10 years ago

You never change Debounce back to false. Change your code so it looks like this:

local Sp = game.Workspace.Part
local Debounce = false
Sp.Touched:connect(function(hit)
    if Debounce == false then
        Debounce = true
        for i = 1, 9 do
            wait(0.1)
            Sp.Transparency = Sp.Transparency + i/10
        end
    end
    Debounce = false
    wait(1)
    Sp.Transparency = 0
    Sp.CanCollide = false
    wait(1)
    Sp.CanCollide = true
end)

Ad

Answer this question