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

Working with IntValues but this script wont work?

I am trying to make it so when the Value gets Lower then 0 then the Brick disappears.

They are all Parented correctly

Health = script.Parent.Health
ShipExplosionPart = script.Parent.ShipExplosionPart
VorCha = script.Parent.VorCha
if Health.Value <= 0 then
VorCha.Transparency = 1
end

2 comments

0

Is this the full script?

0

Yes that is the full script

1 answer

✓ Accepted answer

You need to either put it in a loop, or have a Changed event.

Option 1:

Health = script.Parent.Health
ShipExplosionPart = script.Parent.ShipExplosionPart
VorCha = script.Parent.VorCha
while wait() do
	if (Health.Value <= 0) then
	VorCha.Transparency = 1
end

Option 2:

Health = script.Parent.Health
ShipExplosionPart = script.Parent.ShipExplosionPart
VorCha = script.Parent.VorCha

Health.Changed:connect(function()
	if (Health.Value <= 0) then
		VorCha.Transparency = 1
	end
end)


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