I've written the following code and am having trouble with two if statements (lines 9-14 and lines 16-21). Once hungerValue.Value == (either 50 or 20), the msg.Text does not appear anymore during that play-test.
I need to know how to have the code always be checking the hungerValue.Value, even after the statement has fired.
local hungerArray = {"I'm getting hungry.", "I'm nearly starving."} local msg = Instance.new("Message", game.Workspace) while wait(hungerDecrease) do if hungerValue.Value - 1 >= 0 then hungerValue.Value = hungerValue.Value - 1 end if hungerValue.Value == 50 then msg.Text = hungerArray[1] wait(5) msg:Remove() end if hungerValue.Value == 20 then msg.Text = hungerArray[2] wait(5) msg:Remove() end end