Script dosent work if i play the game

I made a big fireball where you can destroy with a gun if its 0 health.
the problem is it never prints when i play the game

script.Parent.Humanoid.Changed:Connect(function()
	print("value changed")
	if script.Parent.Humanoid.Value <= 0 then
		print("destroyed")
	    rocketp:Abort()
		script.Parent.Anchored = true
		script.Parent.Fire.Enabled = false
		script.Parent.BrickColor = BrickColor.new("Black")
		while true do
			if script.Parent.Transparency <= 0.9 and script.Parent.SelectionSphere.Transparency <= 0.9 then
				wait(0.5)
				script.Parent.Transparency = script.Parent.Transparency + 0.1
				script.Parent.SelectionSphere.Transparency = script.Parent.SelectionSphere.Transparency + 0.1
			else
				break
			end
		end
		event:Fire()
		game:GetService("Debris"):AddItem(script.Parent, 0.1)
	end
end)

no error appears too

3 Likes

Where is the script in relations to the Game Explorer?
(eg: is it in workspace or starter player scripts?)

1 Like

the script is in a fireball part in workspace

Is the “Humanoid” an intvalue?

1 Like

the humanoid is an int value .

Does it print out the 2 prints? Also maybe add more prints to see exactly where it breaks.

well if you delete an Instance it’s children are also deleted so it just deletes itself.

but the problem is it dosent even destroy itself therefore the script thinks the value never changes

it dosent print anyhing it never prints

Is this in a server script? Also how do you change the value, do you change it from the properties tab?

its a server script i change it from the properties tab and shoot it with a gun that changes its value

and nothing happens

First off, when you change it from the properties tab, do you switch to the server before you change it. Also does the gun change it from a local or a server script.

3 Likes