Creature.__newindex = function(Table , Key , Value)
if Key == "Energy" or Key == "Health" then
Table[Key] = math.clamp(Value , 0 , math.huge)
elseif Key == "StatusEffect" and Table.StatusEffect == nil then
Table[Key] = Value
else
Table[Key] = Value
end
end
I can’t find any reason why the error appears.