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

I need help with a script?

I made a script that will create a fire in the characters torso and disables it until the character has 25 health then it enables itself until the character dies.. But it doesn't work

heres my script

local player = game.Players.LocalPlayer
wait()
f = Instance.new("Fire")
f.Parent = player.Character.Torso
f.Enabled = false
if player.Character.Humanoid.Health == 25
	then
	f.Enabled = true
end

Can anyone please help me

1 answer

All I did was add a .Changed event so the script would execute that if then statement whenever the humanoid loses health or something like that.

local player = game.Players.LocalPlayer
wait()
f = Instance.new("Fire")
f.Parent = player.Character.Torso
f.Enabled = false
player.Character.Humanoid.Changed:connect(function() --You want to have the script check whenever the health changes.
if player.Character.Humanoid.Health == 25
    then
    f.Enabled = true
end
end)

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