hades_revisited/mods/hades_greeting/init.lua

34 lines
1.2 KiB
Lua
Raw Normal View History

2020-10-20 05:13:42 -07:00
local S = minetest.get_translator("hades_greeting")
2017-12-22 18:00:24 -08:00
-- Show simple greeting message for new players.
-- Currently only uses the chat.
-- TODO: Think of some better way to do this which doesn't use the chat
2020-10-20 03:38:36 -07:00
local COLOR = "#00FF00"
local msg = function(pname, message)
minetest.chat_send_player(pname, minetest.colorize(COLOR, message))
end
2017-12-22 18:00:24 -08:00
minetest.register_on_newplayer(function(player)
local cb = function(player)
2020-07-24 03:41:33 -07:00
if (not player) or (not player:is_player()) then
return
end
local pname = player:get_player_name()
2020-10-20 03:38:36 -07:00
minetest.sound_play({name="hades_greeting_message"}, {to_player=pname, gain=1.0})
if minetest.is_creative_enabled(pname) then
2020-10-20 05:13:42 -07:00
msg(pname, S("Welcome to planet Hades!"))
msg(pname, S("Creative Mode is active. You have unlimited supplies."))
msg(pname, S("Create the buildings of your dreams and have fun! <END OF TRANSMISSION>"))
2017-12-22 18:00:24 -08:00
else
2020-10-20 05:13:42 -07:00
msg(pname, S("You have stranded on planet Hades."))
msg(pname, S("Search for some water. Lay down fertile sand next to the water and it will soon turn into dirt. Use the crafting guide to see what you can craft."))
msg(pname, S("Survive and build a nice habitable place!"))
msg(pname, S("Good luck! <END OF TRANSMISSION>"))
2017-12-22 18:00:24 -08:00
end
end
2020-10-20 03:38:36 -07:00
minetest.after(3.0, cb, player)
2017-12-22 18:00:24 -08:00
end)