Function issue

  • Thread starter Deleted member 9590
  • Start date
  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
D

Deleted member 9590

Hey, someone see what's wrong with this code?
nothing is happening when I click the slot

Function code:
Code:
function bandeshopdamage(p: player, n: number):
    set {_uuid} to uuid of {_p}
    close {_p}'s inventory
    if {bb::%{bb::%{_uuid}%}%::bankkonto} is more than or equal to {_n}:
        subtract {_n} from {bb::%{bb::%{_uuid}%}%::bankkonto}
        loop {bb::%{bb::%{_uuid}%}%::pmedlemmer::*}:
            send "&8&l&m------------" to loop-value
            send " " to loop-value
            send "{@cprefix}-1%% bandedamage købt." to loop-value
            send "{@cprefix}Køber: &c%{_p}%." to loop-value
            send "{@cprefix}Bandedamage: &d%{bb::%{bb::%{_uuid}%}%::damage}%%%" to loop-value
            send " " to loop-value
            send "&8&l&m------------" to loop-value
            stop
    else:
        set {_money} to "%{bb::%{bb::%{_uuid}%}%::bankkonto} - {_n}%"
        replace all "-" in {_money} with ""
        send "&8&l&m------------" to {_p}
        send " " to {_p}
        send "{@cprefix}Ikke nok penge i bandebanken." to {_p}
        send "{@cprefix}Mangler: &d$%{_money}%" to {_p}
        send " " to {_p}
        send "&8&l&m------------" to {_p}
        stop

Code that executes when certain slot is clicked:
Code:
        if clicked slot is 22:
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 90 and 100:
                bandeshopdamage(player, 3000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 80 and 89:
                bandeshopdamage(player, 5000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 70 and 79:
                bandeshopdamage(player, 12000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 60 and 69:
                bandeshopdamage(player, 25000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 50 and 59:
                bandeshopdamage(player, 4000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 40 and 49:
                bandeshopdamage(player, 6000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 30 and 39:
                bandeshopdamage(player, 7500)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 20 and 29:
                bandeshopdamage(player, 100000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 19 and 19:
                bandeshopdamage(player, 300000)
            if {bb::%{bb::%{%uuid of player%}%}%::damage} is between 1 and 9:
                bandeshopdamage(player, 1000000)
 
Status
Not open for further replies.