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

Why isn't it working?

I made a script which launches a fireball, and I added the damage script.When the fireall deals damage to a humanoid, the script stops working ( I mean that I cannot launch anotherafter I launched the first and it touched a humanoid)

wait(3)
Player = script.Parent.Parent.Parent
n = script.Parent
local debounce = false
mouse = Player:GetMouse()
run = game:GetService("RunService")
function pizza(mouse)
	if debounce == false then
		debounce = true
			local x = Instance.new("Part")
			x.Shape = "Ball"
			x.CanCollide = false
			x.TopSurface = "Smooth"
			x.BottomSurface = "Smooth"
			x.Transparency = 0.45
			x.Parent = Workspace
			x.Size = Vector3.new(10, 50, 10)
			x.BrickColor = BrickColor.new("Bright red")
			x.Name = Player.Name
			y = Instance.new("BodyVelocity")
			y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
			y.velocity = Player.Character.Torso.CFrame.lookVector*110
			x.Parent = Workspace
			y.Parent = x
			f = Instance.new("Fire", x)
			f.Heat = 0
			f.Size = 12
			x.Touched:connect(function(Part) 
    if Part.Parent:FindFirstChild("Humanoid") ~= nil then
		script.Disabled = true
		for i = 1,20 do  
        Part.Parent.Humanoid.Health =  Part.Parent.Humanoid.Health -1
		wait(0.05)
		end
    end
	wait(0.025)
end)
			x.CFrame = Player.Character.Torso.CFrame*CFrame.new(0, 0, -10)
			game.Debris:AddItem(x, 10)

	end
	wait(35)
	debounce = false
end




function onSelected(mouse)
	mouse.Button1Down:connect(function() pizza(mouse) end)
end

n.Selected:connect(onSelected)
		

1 answer

You disabled the script on line 30, and then you never re-enabled it.

2 comments

0

Ah, Thank you.

0

It would really help me if you accepted my answer. It gives both of us 1 rep.

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