I was trying to make a hunger thirst and sleep/energy script for my character, but it wouldn't work. I was also trying to make so if there is a gui on the screen, it will pop above the gui. But i don't know how to do that, so if you know how please tell me.
My script:
while wait(math.random(13,17)) do script.Parent.HungerFrame.Hunger.Size = script.Parent.HungerFrame.Hunger.Size - UDim2.new(0,math.random(1,2),0,0) script.Parent.ThirstFrame.Thirst.Size = script.Parent.ThirstFrame.Thirst.Size - UDim2.new(0,math.random(1,2),0,0) script.Parent.RestFrame.Rest.Size = script.Parent.RestFrame.Rest.Size - UDim2.new(0,1,0,0) end
(I also had that script inside the gui, with the hunger frame and thirst frame and energy frame.)
Some reason it didn't work.
You should try using number values and use a math equation to convert the value into the Guis size. Doing so will allow other scripts to read the Gui and for a much more efficient system.