I am trying to make a HUD that changes depending on how many conditions are met, but each time I try to make it change in Studio's Play Mode (by editing the value's String in the Explorer), the game freezes forever...
Code :
-- All variables are correctly defined above in the script. If you need them, comment the question with the request, and I will edit this code block.
while true do
if main.Value == "" and sub.Value == "" then
print("main & sub are empty")
pBG.Position, hBG.Position = pos[1], pos[2]
mtBG.Visible, mA.Visible, mBG.Visible = false, false, false
stBG.Visible, sA.Visible, sBG.Visible = false, false, false
wait(1)
elseif not main.Value == "" and sub.Value == "" then
print("only sub is empty")
pBG.Position, hBG.Position = pos[4], pos[5]
mtBG.Position, mA.Position, mBG.Position = pos[1], pos[2], pos[3]
mtBG.Visible, mA.Visible, mBG.Visible = true, true, true
stBG.Visible, sA.Visible, sBG.Visible = false, false, false
wait(1)
elseif not main.Value == "" and not sub.Value == "" then
print("nothing is empty")
pBG.Position, hBG.Position = pos[7], pos[8]
mtBG.Position, mA.Position, mBG.Position = pos[4], pos[5], pos[6]
stBG.Position, sA.Position, sBG.Position = pos[1], pos[2], pos[3]
mtBG.Visible, mA.Visible, mBG.Visible = true, true, true
stBG.Visible, sA.Visible, sBG.Visible = true, true, true
wait(1)
end
end
The Studio's Output window does not give any error, because the game freezes as soon as another value check is ran.
Any help will be appreciated!
TheArmoredReaper

1 comment
I'm not going to post this as an answer, as I'm not sure what the problem is, but did you try adding "else wait(1)" after the last elseif?