In studio, this script works just fine and increases the thirst bar up..
script.Parent.Touched:connect(function(hit) print("touched") local Plr = game.Players:GetPlayerFromCharacter(hit.Parent) wait() local ThirstVal = Plr.ThirstVal ThirstVal.Value = ThirstVal.Value + 10 if ThirstVal.Value > 100 then ThirstVal.Value = 100 end end)
It gets triggered when a player steps on an object.
In the real game however, it doesn't work and this error code pops up:
https://gyazo.com/e11d1dafc81587c297712883e307284c
why does this only happen in the real game and not studio? Anything helps.
Can i see the script that gives the player the ThirstVal?