why will this script only work in studio but in the real game it says that an object is not there?
In studio, this script works just fine and increases the thirst bar up..
01 | script.Parent.Touched:connect( function (hit) |
03 | local Plr = game.Players:GetPlayerFromCharacter(hit.Parent) |
05 | local ThirstVal = Plr.ThirstVal |
07 | ThirstVal.Value = ThirstVal.Value + 10 |
08 | if ThirstVal.Value > 100 then |
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.