Solved SkellettProxy: Per-server balance.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

glowgrew

Active Member
Jan 26, 2017
99
7
0
Perm, Russia
Suggested name: -

What I want:
A per-server balance for bungeecord. From which admins can take, add, set balance.

Ideas for commands: /balance <take|add|set> - optional.

Ideas for permissions: -

When I'd like it by: < 2 weeks
 
Function API for network balance system:

The uuid input can be a username or a uuid. SkellettProxy will figure out what you input automatically for you.
code_language.skript:
function getBalance(uuid: text) :: number:
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set {_return} to network variable {balance.%{_this}%}
    if {_return} is not set:
        set network variable {balance.%{_this}%} to 0
        return getBalance({_uuid})
    return "%{_return}%" parsed as number
function setBalance(uuid: text, balance: number):
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_this}%} to {_balance}
function addbalance(uuid: text, add: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_this}%} to {_add} + {_balance}
function removebalance(uuid: text, remove: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_this}%} to {_balance} - {_remove}
If you would like balance system for each bungee server:

code_language.skript:
function getBalance(server: text, uuid: text) :: number:
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set {_return} to network variable {balance.%{_server}%.%{_this}%}
    if {_return} is not set:
        set network variable {balance.%{_server}%.%{_this}%} to 0
        return getBalance({_uuid})
    return "%{_return}%" parsed as number
function setBalance(server: text, uuid: text, balance: number):
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_server}%.%{_this}%} to {_balance}
function addbalance(server: text, uuid: text, add: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_server}%.%{_this}%} to {_add} + {_balance}
function removebalance(server: text, uuid: text, remove: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_server}%.%{_this}%} to {_balance} - {_remove}
 
Last edited by a moderator:
Function API for network balance system:

The uuid input can be a username or a uuid. SkellettProxy will figure out what you input automatically for you.
code_language.skript:
function getBalance(uuid: text) :: number:
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set {_return} to network variable {balance.%{_this}%}
    if {_return} is not set:
        set network variable {balance.%{_this}%} to 0
        return getBalance({_uuid})
    return "%{_return}%" parsed as number
function setBalance(uuid: text, balance: number):
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_this}%} to {_balance}
function addbalance(uuid: text, add: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_this}%} to {_add} + {_balance}
function removebalance(uuid: text, remove: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_this}%} to {_balance} - {_remove}
If you would like balance system for each bungee server:

code_language.skript:
function getBalance(server: text, uuid: text) :: number:
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set {_return} to network variable {balance.%{_server}%.%{_this}%}
    if {_return} is not set:
        set network variable {balance.%{_server}%.%{_this}%} to 0
        return getBalance({_uuid})
    return "%{_return}%" parsed as number
function setBalance(server: text, uuid: text, balance: number):
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_server}%.%{_this}%} to {_balance}
function addbalance(server: text, uuid: text, add: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_server}%.%{_this}%} to {_add} + {_balance}
function removebalance(server: text, uuid: text, remove: number):
    set {_balance} to getPoints("%{_uuid}%")
    set {_this} to bungeecord uuid of "%{_uuid}%"
    set network variable {balance.%{_server}%.%{_this}%} to {_balance} - {_remove}
Спасибо, самый лучший скриптер на форуме. Drink vodka with <3 from glowgrew.