Slugmoon Developer Documentation

website·Indexed 30 days ago

https://dev.slugmoon.com

Developer documentation for the Slugmoon Suite of services, including Slugmoon Warp for game engine integration and API endpoints, Slugmoon Mail for account creation and email delivery, and Slugmoon Nametags for overhead display name systems in games.

Tokens
2K
Snippets
9
Records
18
Agent score
45%

What's inside Slugmoon

  1. Retrieve game information using the Slugmoon Warp API

    Use the api/game-info/(gameId) endpoint to fetch details about a specific game. This endpoint is intended for frontend use but is available for external projects. It requires a gameId as a path parameter and uses the GET method. The response is a JSON object containing the game's ID, server ID, name, description, creator details, player counts, and icon URL.
    GET /api/game-info/123456789
    {
      "gameId": 123456789,
      "serverId": 987654321,
      "name": "My Game",
      "description": "This is a test game.",
      "creator": {
        "id": 123456789,
        "name": "Test Creator",
        "type": "User",
        "isRNVAccount": false,
        "hasVerifiedBadge": false
      },
      "playing": 0,
      "visits": 3505,
      "iconUrl": "https://tr.rbxcdn.com/180DAY-7d82271a5ba86e4e1d0301bcab3d7d2b/512/512/Image/Png/noFilter"
    }
  2. Integrate Order Logging into CafePOS via Addons

    To log orders from CafePOS, create a ModuleScript within the Addons folder of your CafePOS instance (create the folder if it doesn't exist). This module hooks into CafePOS events like OrderCreated, OrderRemoved, OrderClaimed, and OrderCompleted to sync data with the OrderLogModule.
    local Module = require(121652996197382)
    local API = Module.API
    
    local AddonId = 5378 -- This is required for interacting with the API
    local Menu = nil
    local OrderModule = require(game.ServerScriptService:WaitForChild("OrderLogModule"))
    local orders = {}
    
    local Menu = API:Invoke("GetMenu", { ID=AddonId })
    
    local function GetItem(ID)
      for _, Category in pairs(Menu) do
        if Category and Category.Items then
          for _, Item in pairs(Category.Items) do
            if Item and Item.ID == ID then
              return Item
            end
          end
        end
      end
      return nil
    end
    
    return {
      Name = "Order Logging",
    
      Initialise = function(ID)
        AddonId = ID
        Menu = API:Invoke("GetMenu", { ID=AddonId })
      end,
    
      OrderCreated = function(Order)
        local items = {}
        local itemsToProcess = Order.Items
        for _, itemData in pairs(itemsToProcess) do
          local itemId = itemData.ID
          local fullItemDetails = GetItem(itemId)
          if fullItemDetails then
            table.insert(items, fullItemDetails.Name)
          else
            warn("Item with ID:", itemId, "not found in the menu.")
          end
        end
        local order = OrderModule.createOrder(Order.Player, Order.Player, {
          items = items,
          status = "waiting_for_preparation",
        })
        local player = Order.Player
        orders[player] = order.id
        items = {}
      end,
    
      OrderRemoved = function(Order)
        OrderModule.setCancelled(orders[Order.Player])
        orders[Order.Player] = nil
      end,
    
      OrderClaimed = function(Order, Player)
        OrderModule.setPreparing(orders[Order.Player], Player)
      end,
    
      OrderUnclaimed = function(Order, Player)
        OrderModule.setReprepare(orders[Order.Player])
      end,
    
      OrderCompleted = function(Order, Player)
        OrderModule.setComplete(orders[Order.Player])
        orders[Order.Player] = nil
      end,
    
      OrdersUpdated = function(Orders)
      end,
    }
  3. Join a game using Slugmoon Warp

    To join a game via Slugmoon Warp, you must first obtain the unique Game ID and Server ID for the target game. Once you have these identifiers, follow these steps:

    1. Navigate to the Slugmoon Warp site at https://warp.slugmoon.lol.
    2. Enter the Game ID and Server ID into the respective input fields.
    3. Click the 'Join Game' button.
    4. Confirm the join request when prompted.
    5. When the browser pop-up appears asking to open the Roblox Game Client, click 'Open' to launch the game.

    To avoid the confirmation prompt on subsequent joins, check the 'Skip this prompt next time' checkbox.

  4. Embed the Slugmoon Warp site using an iframe

    To integrate Slugmoon Warp into your own website, use an HTML iframe pointing to https://warp.slugmoon.lol. You can customize the width and height attributes of the iframe to match your site's layout requirements.
    <iframe src="https://warp.slugmoon.lol" title="Slugmoon Warp" width="100%" height="1000px" style="border: none;"></iframe>
  5. Install Slugmoon Warp Game Engine via Module ID

    You can integrate Slugmoon Warp by requiring the engine via its asset ID within a ModuleScript located in ServerScriptService. You must define a whitelist function that returns a boolean to determine which players are authorized to use Slugmoon Warp commands.
    -- Place this in a ModuleScript in ServerScriptService
    require(112993552440807)
    
    return {
    	whitelist = function(player: Player)
    		if player:GetRankInGroup(game.CreatorId) >= 24 then
    			return true
    		else
    			return false
    		end
    	end
    }
  6. Prerequisites for Hyra CafePOS Order Logging

    To implement the Order Logging system, you must meet the following requirements:

    • An active Hyra Instance.
    • Ability to create an API key.
    • Ownership of easyPOS's CafePOS.
    • HTTP requests must be enabled in your game settings.
  7. Send an email using Slugmoon Mail

    To send your first email through the Slugmoon Mail interface:

    1. Click the Compose button in the bottom right corner of the page.
    2. Enter the recipient's email address in the To field.
    3. Enter the message content in the Subject and Body fields.
    4. Click the Send button to deliver the email.
  8. Create an OrderLogModule exporter

    The Order Logging module requires a specific exporter module to be present in the ServerScriptService. Create a ModuleScript named OrderLogModule and require the core order log library.
    local orderLog = require(15254660066)
    return orderLog