Add /tp Command To Co-Exist With /bring And /go-to (#65)

* Add !evolution to auto-chat.lua

* Add !evolution to chat-bot.cfg

* Fixed syntax error and converted to two decimal places

* Add the /tp command to co-exist with /bring and /go-to

* Add /tp command to co-exist with /bring and /go-to into admin.lua

* Fix /tp

* Fix admin.lua

* Fixed Admin.tp call
This commit is contained in:
JCA122204
2018-06-01 15:10:28 -04:00
committed by Cooldude2606
parent 50a5d0baa8
commit b9b43504a5
2 changed files with 23 additions and 1 deletions

View File

@@ -214,4 +214,16 @@ function Admin.bring(player,by_player)
local _player = Game.get_player(by_player)
if not player or not _player then return end
player.teleport(_player.surface.find_non_colliding_position('player',_player.position,32,1),_player.surface)
end
end
function Admin.tp(from_playaer, to_player)
local _from_player = Game.get_player(from_player)
local _to_player = Game.get_player(to_player)
if not _from_player or not _to_player then return end
if Game.players[_from_player].health >= 0 then return end
if Game.players[_to_player].health >= 0 then return end
_from_player.teleport(_to_player.surface.find_non_colliding_position('player',_to_player.position,32,1),_to_player.surface)
end

View File

@@ -19,3 +19,13 @@ commands.add_command('bring', 'Bring a player to your location', {'player'}, fun
if not player then player_return({'commands.invalid-player',args.player}) return commands.error end
Admin.bring(player,event)
end)
commands.add_command('tp', 'Teleport a player to another player\'s location', {'from', 'to'}, function(event,args)
local from_player = Game.get_player(args.from)
if not from_player then player_return({'commands.invalid-player',args.from_player}) return commands.error end
local to_player = Game.get_player(args.to)
if not to_player then player_return({'commands.invalid-player',args.to_player}) return commands.error end
Admin.tp(from_player, to_player)
end)