43 lines
1.4 KiB
Lua
43 lines
1.4 KiB
Lua
-- rumble - Client side mod for Minetest
|
|
-- Scripted by: Li0n
|
|
|
|
local modname = minetest.get_current_modname()
|
|
local damage_taken = "["..modname.."]".." damage_taken "
|
|
local player_died = "["..modname.."]".." player_died"
|
|
local local_hp_change = "["..modname.."]".." hp_change"
|
|
-- local rightclick =
|
|
|
|
-- step 1 (start)
|
|
minetest.register_on_mods_loaded(function()
|
|
minetest.display_chat_message(modname.." mod loaded. May the rumble be with you!")
|
|
return false
|
|
end)
|
|
|
|
-- step 2 (get hurt)
|
|
minetest.register_on_damage_taken(function(hp)
|
|
minetest.display_chat_message(damage_taken..tostring(hp))
|
|
minetest.log("action", damage_taken..tostring(hp))
|
|
return false
|
|
end)
|
|
|
|
-- step 3 (die)
|
|
minetest.register_on_death(function()
|
|
minetest.display_chat_message(player_died)
|
|
minetest.log("action", player_died)
|
|
return false
|
|
end)
|
|
|
|
-- step 4 (track hp level)
|
|
-- minetest.register_on_player_hpchange(function(player, hp_change)
|
|
-- minetest.display_chat_message(hp_change)
|
|
-- minetest.log("action", hp_change)
|
|
-- return false
|
|
-- end)
|
|
|
|
-- step 5 (let players click on you)
|
|
-- minetest.register_on_rightclickplayer(function(player, clicker)
|
|
-- minetest.display_chat_message("["..modname"] "..tostring(clicker).." right_clicked "..tostring(player))
|
|
-- minetest.log("action", "["..modname"] "..tostring(clicker).." right_clicked "..tostring(player))
|
|
-- return false
|
|
-- end)
|