BAE Support | !help command teleport

Dose anyone have any clue on how to make it so when you click on a BAE ‘notif’ it teleport you to the player that triggers the command? (e.g

player 1 - !help

player 2 - BAE notification pops up notifying a MR+ that someone needs help

clicks on prompt

teleports to player 1)

So far, I have already got it so the notifications pop up but I can’t get my head round the teleport bit.

I suggest not to ping him

Alrighty. Thanks for letting me know.

This is the code for the notification;

local Player = Args[1]
		for i,v in pairs(game.Players:GetChildren()) do
			if returnPermissions(v) >= 1 then
				remoteEvent:FireClient(v,"Notif","Help Requested", "Click to teleport", "")
			end	
		end
	end

Hey there!

So you will need to create a button then make it so when a MR+ clicks on it, they teleport (you need to change the position) to them.

If you need help coding this, lmk and I can help with a basic example!

1 Like

Alright, I will play around tomorrow. I have the button, just can’t get the actual teleportation part working. If you could provide me with a basic script, that would be helpful.

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 actionPrefix = Data[1][6]
    local returnPlayers = Data[1][7]

    -- Keep track of the last admin who clicked the notification
    local lastAdminClicked = nil

    -- Plugin Configuration --
    local pluginName = 'help'
    local pluginPrefix = actionPrefix
    local pluginLevel = 1
    local pluginDescription = "Call for an admin's support."

    -- Plugin Function --
    local function pluginFunction(Args)
        local Player = Args[1]

        -- Check if an admin has already clicked the notification
        if lastAdminClicked then
            return "An admin is already on their way to assist you."
        end

        -- Store the admin who clicked the notification
        lastAdminClicked = Player

        -- Notify all admins except the one who clicked
        for _, admin in ipairs(returnPlayers()) do
            if admin ~= Player and returnPermissions(admin) >= 1 then
                remoteEvent:FireClient(admin, "Notif", "Help Requested", "Click to teleport", "")
            end
        end
        return "Admins have been notified about your request."
    end

    -- Register the plugin command
    Commands[pluginName] = pluginFunction

    -- Handle admin teleportation
    remoteFunction.OnServerInvoke = function(Player, Data)
        if Data == "TeleportAdmin" and lastAdminClicked == Player then
            -- Implement teleportation logic here
            -- Example: game.Workspace.AdminSpawn.CFrame = Player.Character.HumanoidRootPart.CFrame

            -- Clear the last admin who clicked
            lastAdminClicked = nil
            return true -- Indicate successful teleportation
        end
    end

    -- Return the plugin details
    return pluginName, pluginFunction, pluginLevel, pluginPrefix, {pluginName, pluginDescription}
end

return Plugin

click teleport

I believe this works:

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]

    -- Plugin Configuration --
    local pluginName = 'help'
    local pluginPrefix = actionPrefix
    local pluginLevel = 0
    local pluginUsage = ""
    local pluginDescription = "Call for an admin's support."

    -- Example Plugin Function --
    local function pluginFunction(Args)
        local Player = Args[1]
        for _, Admin in ipairs(game.Players:GetPlayers()) do
            if returnPermissions(Admin) >= 1 then
                -- Send notification to admins
                remoteEvent:FireClient(Admin, "Notif", "Help Requested", "Click to teleport", Player.Name)

                -- Teleport admin to the player requesting help
                Admin.Character:MoveTo(Player.Character.HumanoidRootPart.Position)
            end
        end
    end

    -- Return Everything to the MainModule --
    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

I tested it and it worked for me.

Do you have 2 accounts, because your other account has been DMing me.

Yes, two separate emails because I keep forgetting the password to one.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.