make travelcenter button actually work

This commit is contained in:
tchncs 2018-08-04 17:37:59 +02:00
parent a26ce76b23
commit f33dd34f46

View File

@ -1,12 +1,13 @@
unified_inventory.register_button("illuna_travelcenter", { unified_inventory.register_button("illuna_travelcenter", {
type = "image", type = "image",
image = "travelnet_inv.png", image = "travelnet_inv.png",
tooltip = "Teleport to the Travelcenter", tooltip = "Teleport to the Illuna Travelcenter",
hide_lite = true, hide_lite = true,
action = function(player, param) action = function(player)
local player = minetest.get_player_by_name(name) local playername = player:get_player_name()
local travelcenterPos = minetest.setting_get("travelcenter_pos") local travelcenterPos = minetest.settings:get("travelcenter_pos")
player:setpos(travelcenterPos) local color = minetest.settings:get("color_success")
--minetest.chat_send_player(name, core.colorize(color_success, "Alrighty, have fun exploring.")) player:setpos(minetest.string_to_pos(travelcenterPos))
minetest.chat_send_player(playername, core.colorize(color, "Alrighty, have fun traveling."))
end end
}) })