Here's the line that It says attempt to compare two userdata values
1 | if .Parent.Bars.Thirst.Amount.Size > = UDim 2. new( 0 , 0 , 0 , 0 ) then |
2 | local KillPlayer = game.Players.LocalPlayer.Character.Humanoid |
3 | Humanoid.Health = - 1 |
4 | end |
Instead of comparing GUI sizes, I'm pretty sure you have a IntValue or NumberValue that stores how much thirst there is. Or if you don't already add a IntValue into Amount and do this;
1 | local TA = script.Parent:WaitForChild( 'Bars' ).Thirst.Amount.IntValue --ThirstAmount |
2 |
3 | if TA.Value < = 0 then |
4 | local KillPlayer = game.Players.LocalPlayer.Character.Humanoid |
5 | KillPlayer.Health = 0 -- 0 Health kills player |
6 | end |
If this helped then please accept answer ;)