mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Added Teleport Commands
This commit is contained in:
35
modules/ExpGamingCommands/teleport/control.lua
Normal file
35
modules/ExpGamingCommands/teleport/control.lua
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
--- A full ranking system for factorio.
|
||||||
|
-- @module ExpGamingCommands.kill
|
||||||
|
-- @author Cooldude2606
|
||||||
|
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||||
|
|
||||||
|
local Admin = require('ExpGamingAdmin.Teleport')
|
||||||
|
|
||||||
|
--- Teleports the user to the player given
|
||||||
|
-- @command go-to
|
||||||
|
-- @param player player to go to
|
||||||
|
commands.add_command('go-to', 'Go to a player\'s location', {
|
||||||
|
['player']={true,'player-online'}
|
||||||
|
}, function(event,args)
|
||||||
|
Admin.go_to(args.player,event)
|
||||||
|
end)
|
||||||
|
|
||||||
|
--- Teleports a player to the user
|
||||||
|
-- @command bring
|
||||||
|
-- @param player player to go to
|
||||||
|
commands.add_command('bring', 'Bring a player to your location', {
|
||||||
|
['player']={true,'player-online'}
|
||||||
|
}, function(event,args)
|
||||||
|
Admin.bring(args.player,event)
|
||||||
|
end)
|
||||||
|
|
||||||
|
--- Teleports one player to another
|
||||||
|
-- @command tp
|
||||||
|
-- @param player_one the player that is teleported
|
||||||
|
-- @param player_two the player who is the destination
|
||||||
|
commands.add_command('tp', 'Teleport a player to another player\'s location', {
|
||||||
|
['player_one']={true,'player-online'},
|
||||||
|
['player_two']={true,'player-online'}
|
||||||
|
}, function(event,args)
|
||||||
|
Admin.tp(args.player_one,args.player_two)
|
||||||
|
end)
|
||||||
24
modules/ExpGamingCommands/teleport/softmod.json
Normal file
24
modules/ExpGamingCommands/teleport/softmod.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "teleport",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"type": "Module",
|
||||||
|
"description": "Adds a few commands used to teleport players.",
|
||||||
|
"location": "<blank>",
|
||||||
|
"keywords": [
|
||||||
|
"Teleport",
|
||||||
|
"Tp",
|
||||||
|
"Bring",
|
||||||
|
"GoTo",
|
||||||
|
"ExpGaming",
|
||||||
|
"Command",
|
||||||
|
"Admin",
|
||||||
|
"Tools"
|
||||||
|
],
|
||||||
|
"author": "Cooldude2606",
|
||||||
|
"contact": "Discord: Cooldude2606#5241",
|
||||||
|
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
|
||||||
|
"dependencies": {
|
||||||
|
"ExpGamingCore.Commands": "^4.0.0",
|
||||||
|
"ExpGamingAdmin.Teleport": "^4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
--[[
|
|
||||||
Explosive Gaming
|
|
||||||
|
|
||||||
This file can be used with permission but this and the credit below must remain in the file.
|
|
||||||
Contact a member of management on our discord to seek permission to use our code.
|
|
||||||
Any changes that you may make to the code are yours but that does not make the script yours.
|
|
||||||
Discord: https://discord.gg/r6dC2uK
|
|
||||||
]]
|
|
||||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
|
||||||
|
|
||||||
commands.add_command('go-to', 'Go to a player\'s location', {'player'}, function(event,args)
|
|
||||||
local player = Game.get_player(args.player)
|
|
||||||
if not player then player_return({'commands.invalid-player',args.player}) return commands.error end
|
|
||||||
Admin.go_to(player,event)
|
|
||||||
end)
|
|
||||||
|
|
||||||
commands.add_command('bring', 'Bring a player to your location', {'player'}, function(event,args)
|
|
||||||
local player = Game.get_player(args.player)
|
|
||||||
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)
|
|
||||||
Reference in New Issue
Block a user