Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to Make Spleef... Again?

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

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.