Update init.lua

This commit is contained in:
Zemtzov7 2022-11-20 00:39:48 +05:00 committed by GitHub
parent 26ca869cfa
commit bfdd151287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,10 @@ minetest.register_chatcommand("home", {
description = S("Teleport you to your home point"),
privs = {home = true},
func = function(name)
local player = minetest.get_player_by_name(name)
if not player then
return false, "This command can be executed in-game only"
end
if sethome.go(name) then
return true, S("Teleported to home!")
end