Hi there, apologies for the delayed response let’s get you the help you need.
So I’ve just had a chance to get BAE and check out how their custom commands work, and it’s actually reletively simple. I found that it might be easier to create a different command using their plugins instead of trying to override the goto command. In this case I created a plugin command and made the command gotol
Then using the example plugin provided I made some small adjustments to come up with this very simple script:
As you can see, I have defined the table of zones/locations at the top of the script, since it was convinient to put it there, and BAE does the rest, all you need to do is utilize the arguments. You can get the player’s character by using the Player
variable defined at the start of the pluginFunction
function and teleport that around.
If you have any questions let me know
local Locations = {
location1 = {
CFrame.new(0,0,0),
CFrame.new(0,0,5)
},
location2 = {
CFrame.new(0,0,0),
CFrame.new(0,0,2)
}
}
local Plugin = function(...)
local Data = {...}
-- Included Functions and Info --
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8]
local pluginName = 'gotol'
local pluginPrefix = Prefix
local pluginLevel = 1
local pluginUsage = "Zone Name"
local pluginDescription = "Hey, this is a plugin example.\nIt's also multi-line!"
local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
local Player = Args[1] -- Player who ran the command
if Args[3] then -- Checking if a location name was given
local Location = Locations[Args[3]:lower()] -- Finding the location name without needing to be case sensitive
if Location then -- Making sure it exists
-- Then here you can teleport the player to a random location from the table.
print('Teleport', Player, 'to random location in', Args[3], 'Location:', Location[math.random(#Location)])
end
end
end
local descToReturn
if pluginUsage ~= "" then
descToReturn = pluginPrefix..pluginName..' '..pluginUsage..'\n'..pluginDescription
else
descToReturn = pluginPrefix..pluginName..'\n'..pluginDescription
end
return pluginName,pluginFunction,pluginLevel,pluginPrefix,{pluginName,pluginUsage,pluginDescription}
end
return Plugin