From 5e2ddec0db57aba689c965d721a01631392d53ab Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sat, 20 Feb 2021 10:18:07 +0100 Subject: [PATCH] Fix #9 (POINT system is not working) --- init.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 7906f73..5d908f5 100644 --- a/init.lua +++ b/init.lua @@ -122,8 +122,19 @@ end -- local function check_points(player) local player_attributes = player:get_meta() - local points = player_attributes:get_float("lumberjack_tree_points") or LUMBERJACK_TREE_POINTS - points = points + ( player_attributes:get_float("lumberjack_sapl_points") or LUMBERJACK_SAPL_POINTS ) + local points + + if player_attributes:get("lumberjack_tree_points") then + points = player_attributes:get_float("lumberjack_tree_points") + else + points = LUMBERJACK_TREE_POINTS + end + + if player_attributes:get("lumberjack_sapl_points") then + points = points + player_attributes:get_float("lumberjack_sapl_points") + else + points = points + LUMBERJACK_SAPL_POINTS + end if points > 0 then return false