Numeric value not detected by local script in player gui

ajuta1

ajuta2

ajuta3

first script changes hunger value and a ui’s scale based of that value (located in a frame in a screengui in startergui)

second script is a simple one that detects a part getting clicked and fires a local event (located in a part)

third script is a local script that changes the hunger value of the player that clicked the part (located in the same part as second script)

the problem is: the third script isn’t counted for by the first script and the player’s hunger value doesn’t change, any ideas why?

Try to reference the property directly at the end of the third script add something like

game.Players.‘’.Hunger.Value = hunger

1 Like

it didn’t work, but thanks for the reply

Ask for the Value of the Instance when you need it, not when the script loads.

local hunger = script.Parent.Hunger

while wait(0.1) do
if hunger.Value > -1 and hunger.Value < 101 then
2 Likes

did that and it still it isn’t working, thanks for the reply tho

First script and third script seems to access diferent hunger values.

I suppose that happened, I tinkered with them and found a solution :+1:

FRUMOS1

FRUMOS2

time to see if it works on multiplayer !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.