1
0
Disbranĉigi 0
Ĉi tiu deponejo arĥiviĝis je 2024-01-28. Vi povas vidi kaj elŝuti dosierojn, sed ne povas puŝi nek raporti problemojn nek tirpeti.
minetest_ocd3/mods/point/init.lua

27 lines
772 B
Lua
Raw Permalink Normal View History

2018-09-02 09:53:31 -05:00
minetest.register_chatcommand("pointing", {
description = "Print what you're pointing at",
func = function(name)
local player = minetest.get_player_by_name(name)
local pos = vector.round(player:getpos())
if player then
if minetest.settings:get_bool("enable_damage") then
player:set_hp(0)
lightning.strike(pos)
return true
else
for _, callback in pairs(core.registered_on_respawnplayers) do
if callback(player) then
return true
end
end
-- There doesn't seem to be a way to get a default spawn pos from the lua API
return false, "No static_spawnpoint defined"
end
else
-- Show error message if used when not logged in, eg: from IRC mod
return false, "You need to be online to be killed!"
end
end
})