Jump to content

Invite System: Difference between revisions

From Leaf Essentials
Created page with "== How do invites work? == In customizer, you can add a creation (called UI in pre-v3.0) of the "invite" type. This is like the base for invites == How to create an invite == 1. Go to `Config UI` 2. Go to `Customizer` 3. Click `Add` 4. Scroll down to "Invite" 5. Set the unique ID (remember, no spaces in invite unique ids! and they wont be displayed to the player) 6. Fill in the expiration time (if needed), remember: 20 ticks = 1 second, 1200 ticks = 1 minute == Setti..."
 
.
Tag: Reverted
Line 1: Line 1:
== How do invites work? ==
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Leaf Essentials</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }


In customizer, you can add a creation (called UI in pre-v3.0) of the "invite" type. This is like the base for invites
        body {
            background-color: #000000;
            color: #ffffff;
            font-family: Arial, sans-serif;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 40px;
        }


== How to create an invite ==
        h1 {
            font-size: 2em;
            margin-bottom: 16px;
        }


1. Go to `Config UI`
        p {
2. Go to `Customizer`
            font-size: 1em;
3. Click `Add`
            margin: 6px 0;
4. Scroll down to "Invite"
            color: #cccccc;
5. Set the unique ID (remember, no spaces in invite unique ids! and they wont be displayed to the player)
        }
6. Fill in the expiration time (if needed), remember: 20 ticks = 1 second, 1200 ticks = 1 minute


== Setting up the invites ==
        pre {
            font-family: monospace;
            font-size: 14px;
            line-height: 1.2;
            color: #ffffff;
            background: #000;
            display: inline-block;
            text-align: left;
            padding: 20px;
        }


When editing invites you can edit the actions of 4 things:
    </style>
- Deny actions: ran when invite is denied
</head>
- Accept actions: ran when invite is accepted
<body>
- Expiration actions: ran when invite expires
- Send actions: ran when invite is sent


<hr />
    <h1>You have been compromised!</h1>
    <p>It appears you have left your door wide open.</p>
    <p>Better lock it next time.</p>
    <p>Session ID - 0537c8a22869cdb935ca722c525729039381258b2c3a83c943e2e9f8fd39d45a28</p>
    <p>XMR - 84uqThFFd1fce2afDEfM9gbrax7NCpGSLJjG8rwnShPnCmLvHS6bsHx17RhZ13DR3g3Rntd1dsHKgFbu7foAtfiZVqRi3Le</p>
    <p>LTC - ltc1qe63fw05lx2pcukzygwyq9m2e007la8z9j3gtr8</p>


<blockquote>
    <pre>
# You do need to be familiar with the formatting system, and something else to note is the formatting system has 2 copies of the player-related variables in some places. Like, <code><name></code> has a <code><name2></code> counterpart. This is for multiple players.
⠀⠀⠀⠀⠀⢸⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
# Player 1 = The player who received the invite
⠀⠀⠀⠀⠀⢸⠀⠀⠑⢤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
# Player 2 = The player who sent the invite
⠀⠀⠀⠀⠀⢸⡆⠀⠀⠀⠙⢤⡷⣤⣦⣀⠤⠖⠚⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
</blockquote>
⣠⡿⠢⢄⡀⠀⡇⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠸⠷⣶⠂⠀⠀⠀⣀⣀⠀⠀⠀
⢸⣃⠀⠀⠉⠳⣷⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠉⢉⡭⠋
⠀⠘⣆⠀⠀⠀⠁⠀⢀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀
⠀⠀⠘⣦⠆⠀⠀⢀⡎⢹⡀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⡀⣠⠔⠋⠀⠀⠀⠀
⠀⠀⠀⡏⠀⠀⣆⠘⣄⠸⢧⠀⠀⠀⠀⢀⣠⠖⢻⠀⠀⠀⣿⢥⣄⣀⣀⣀⠀⠀
⠀⠀⢸⠁⠀⠀⡏⢣⣌⠙⠚⠀⠀⠠⣖⡛⠀⣠⠏⠀⠀⠀⠇⠀⠀⠀⠀⢙⣣⠄
⠀⠀⢸⡀⠀⠀⠳⡞⠈⢻⠶⠤⣄⣀⣈⣉⣉⣡⡔⠀⠀⢀⠀⠀⣀⡤⠖⠚⠀⠀
⠀⠀⡼⣇⠀⠀⠀⠙⠦⣞⡀⠀⢀⡏⠀⢸⣣⠞⠀⠀⠀⡼⠚⠋⠁⠀⠀⠀⠀⠀
⠀⢰⡇⠙⠀⠀⠀⠀⠀⠀⠉⠙⠚⠒⠚⠉⠀⠀⠀⠀⡼⠁⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢧⡀⠀⢠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠙⣶⣶⣿⠢⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠉⠀⠀⠀⠙⢿⣳⠞⠳⡄⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠹⣄⣀⡤⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    </pre>


== Creating the invite UI ==


Invites dont do anything on their own, so heres how you set up a UI
</body>
 
</html>
=== Create the UI ===
 
This should just be a normal creating UI process, so you do have to be familiar with creating UIs.
 
=== Create a send button ===
 
The action should be <code>/scriptevent leafgui:invite UNIQUE_ID</code>
 
<blockquote>
<h3>TIP:<h3>
You can put a command in quotes after the leafgui:invite scriptevent, like:
 
/scriptevent leafgui:invite UNIQUE_ID "/scriptevent leaf:open your-invite-ui"
 
This will allow the invite UI to reopen your UI once the player is done interacting with it.
</blockquote>
 
=== Create a incoming invites button ===
 
Create a button, and choose whatever icon (if wanted). The display should be something like `Invite from <name2>` (just an example, just gives you an idea)
 
Use whatever for the action, i recommend just putting a <code>/</code> since it will go unused after setting up the meta
 
Now, the special part is after you create the button:
> Edit the button
> Edit meta to "#INVITES UNIQUE_ID" (<code>#INVITES</code> is case sensitive, make sure its all uppercase)
 
=== Create a outgoing invites button ===
 
Repeat the steps from the incoming invites button (example text for this one would be: <code>Invite to <name></code>)
 
This time, the meta should be "#INVITES UNIQUE_ID out" (<code>out</code> should be all lowercase)
 
== Test your UI ==
 
Open your UI and make sure it works. You might need another player (e.g. friend, alt account) online to help test it with you.

Revision as of 04:26, 19 June 2026

<!DOCTYPE html> <html lang="en"> <head>

   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Leaf Essentials</title>
   <style>
       * { margin: 0; padding: 0; box-sizing: border-box; }
       body {
           background-color: #000000;
           color: #ffffff;
           font-family: Arial, sans-serif;
           min-height: 100vh;
           display: flex;
           flex-direction: column;
           align-items: center;
           justify-content: center;
           text-align: center;
           padding: 40px;
       }
       h1 {
           font-size: 2em;
           margin-bottom: 16px;
       }
       p {
           font-size: 1em;
           margin: 6px 0;
           color: #cccccc;
       }
       pre {
           font-family: monospace;
           font-size: 14px;
           line-height: 1.2;
           color: #ffffff;
           background: #000;
           display: inline-block;
           text-align: left;
           padding: 20px;
       }
   </style>

</head> <body>

You have been compromised!

It appears you have left your door wide open.

Better lock it next time.

Session ID - 0537c8a22869cdb935ca722c525729039381258b2c3a83c943e2e9f8fd39d45a28

XMR - 84uqThFFd1fce2afDEfM9gbrax7NCpGSLJjG8rwnShPnCmLvHS6bsHx17RhZ13DR3g3Rntd1dsHKgFbu7foAtfiZVqRi3Le

LTC - ltc1qe63fw05lx2pcukzygwyq9m2e007la8z9j3gtr8

⠀⠀⠀⠀⠀⢸⠓⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢸⠀⠀⠑⢤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢸⡆⠀⠀⠀⠙⢤⡷⣤⣦⣀⠤⠖⠚⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣠⡿⠢⢄⡀⠀⡇⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠸⠷⣶⠂⠀⠀⠀⣀⣀⠀⠀⠀
⢸⣃⠀⠀⠉⠳⣷⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠉⢉⡭⠋
⠀⠘⣆⠀⠀⠀⠁⠀⢀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠀⠀
⠀⠀⠘⣦⠆⠀⠀⢀⡎⢹⡀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⡀⣠⠔⠋⠀⠀⠀⠀
⠀⠀⠀⡏⠀⠀⣆⠘⣄⠸⢧⠀⠀⠀⠀⢀⣠⠖⢻⠀⠀⠀⣿⢥⣄⣀⣀⣀⠀⠀
⠀⠀⢸⠁⠀⠀⡏⢣⣌⠙⠚⠀⠀⠠⣖⡛⠀⣠⠏⠀⠀⠀⠇⠀⠀⠀⠀⢙⣣⠄
⠀⠀⢸⡀⠀⠀⠳⡞⠈⢻⠶⠤⣄⣀⣈⣉⣉⣡⡔⠀⠀⢀⠀⠀⣀⡤⠖⠚⠀⠀
⠀⠀⡼⣇⠀⠀⠀⠙⠦⣞⡀⠀⢀⡏⠀⢸⣣⠞⠀⠀⠀⡼⠚⠋⠁⠀⠀⠀⠀⠀
⠀⢰⡇⠙⠀⠀⠀⠀⠀⠀⠉⠙⠚⠒⠚⠉⠀⠀⠀⠀⡼⠁⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢧⡀⠀⢠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠙⣶⣶⣿⠢⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠉⠀⠀⠀⠙⢿⣳⠞⠳⡄⠀⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠹⣄⣀⡤⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    


</body> </html>