Log in to vote

How to make a hunger, thirst, and energy script?

Asked by 7 years ago

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.

Can you place your code into the code block next time? Thewsomeguy 448 — 7y
Yes, sorry. BreBreGaming 10 — 7y

1 answer

Log in to vote
Answered by
Marolex 45
7 years ago

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.

confusing... But thanks! BreBreGaming 10 — 7y

Answer this question