Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 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.

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

1 answer

Log in to vote
0
Answered by
Marolex 45
10 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.

0
confusing... But thanks! BreBreGaming 10 — 10y
Ad

Answer this question