Fixed edge case for bonus

This commit is contained in:
Cooldude2606
2021-05-06 17:25:07 +01:00
parent 9933857b4f
commit cb2522dcb4

View File

@@ -24,6 +24,7 @@ PlayerBonus:set_metadata{
--- Apply a bonus amount to a player --- Apply a bonus amount to a player
local function apply_bonus(player, amount) local function apply_bonus(player, amount)
if not amount then return end if not amount then return end
if not player.character then return end
for bonus, min_max in pairs(config) do for bonus, min_max in pairs(config) do
local increase = min_max[2]*amount local increase = min_max[2]*amount
player[bonus] = min_max[1]+increase player[bonus] = min_max[1]+increase