minetest.register_abm(function(p, node, user)
{nodenames = {"stargate:event_horizon"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_player_count, active_player_count_wider)
local objs = minetest.env:get_players_inside_radius(pos, 2)
if objs[1]==nil then
local name = user:get_player_name()
--top row
if minetest.env:get_node({x = p.x, y = p.y + 2, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x + 1, y = p.y + 2, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x - 1, y = p.y + 2, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x + 2, y = p.y + 2, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x - 2, y = p.y + 2, z = p.z}).name == "stargate:gateblock" then
--middle row
if minetest.env:get_node({x = p.x + 2, y = p.y, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x - 2, y = p.y, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x + 2, y = p.y + 1, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x + 2, y = p.y - 1, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x - 2, y = p.y + 1, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x - 2, y = p.y - 1, z = p.z}).name == "stargate:gateblock" then
--bottom row
if minetest.env:get_node({x = p.x + 1, y = p.y - 2, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x - 1, y = p.y - 2, z = p.z}).name == "stargate:gateblock" then
if minetest.env:get_node({x = p.x, y = p.y - 2, z = p.z}).name == "stargate:gateblock" then
pos_sur = p
minetest.chat_send_player(name, "Teleporting to stargate B...")
-- Set the coordinates of stargate B here (or where you want people to teleport to on using stargate B)
user:setpos({x = pos_sur.x - 1, y = -20000, z = pos_sur.z + 1})
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end)
what about using the pointed_thing_under function along with a check to see if the player is directly in front of the stargate
Something like this but in LUA:
IF pointed_thing_under = stargate:event_horizon AND Player_position = (X1,Y1,Z1 OR X2,Y2,Z2 OR X3,Y3,Z3 {Player is directly in front of stargate})
THEN set Player_position = X,Y,Z {Destination Gate}
END
I dont know LUA programming yet ( i'm trying to learn ) but maybe this could help trigger the teleport
Or possibly a non-flowing liquid that triggers the teleport when entered (like Lava but it teleports the player instead of damaging them)
Segfault make it so whenever you put all the stuff that u need to craft, you can craft 2 of them.
I downloaded the latest file ad I exstracted the files but the pictures didn't come out. Please healp
Users browsing this forum: No registered users and 19 guests