Bool value goes on but nothing happens

There are no errors


local states = script.Parent

local character = states.Parent
local humanoid = character.Humanoid

local onFire = states.OnFire


while onFire == true do

	wait(0.5)
	humanoid:TakeDamage(15)

end

1 Like

You arent getting the Value of the BoolValue, you are checking if the BoolValue is exactly equal to true which it isnt, It holds a boolean, not Is a boolean

while onFire.Value == true do

	task.wait(.5)
	humanoid:TakeDamage(15)

end

2 Likes

Still no errors and its not working.

1 Like

Lua reads this has BoolValue == true, which is false. You need to get the value of the bool value, BoolValue.Value == true or just BoolValue.Value in the while loop condition.

while task.wait(0.5) do
    if onFire.Value then
        humanoid:TakeDamage(15)
    end
end
2 Likes

Thank you.

Roblox doesn’t let me type less than 30

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.