diff options
author | rubenwardy <anjayward@gmail.com> | 2014-05-02 19:11:21 +0100 |
---|---|---|
committer | rubenwardy <anjayward@gmail.com> | 2014-05-02 19:11:21 +0100 |
commit | 8bd3658d9ee363c55225c63f867a8ebf70c44b6e (patch) | |
tree | e540f84f5eca80259ab56f026f937800f8e96bf7 /triggers.lua | |
parent | 8adf859127a3cf3218811c3e6d9ff4b6a3aff1a8 (diff) |
first word award and bug fixes
Diffstat (limited to 'triggers.lua')
-rw-r--r-- | triggers.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/triggers.lua b/triggers.lua index cdff4ae..b6005be 100644 --- a/triggers.lua +++ b/triggers.lua @@ -124,13 +124,13 @@ end) minetest.register_on_dieplayer(function(player) -- Run checks - if not player or not player:get_player_name() or player:get_player_name()=="" then + local name = player:get_player_name() + if not player or not name or name=="" then return end - -- Get player - local name = player:get_player_name() - awards.assertPlayer(playern) + -- Get player + awards.assertPlayer(name) local data = awards.players[name] -- Increment counter @@ -156,7 +156,8 @@ end) minetest.register_on_chat_message(function(name, message) -- Run checks - if not name then + local idx = string.find(message,"/") + if not name or (idx ~= nil and idx <= 1) then return end |