D
Deleted member 9590
Hey, someone see what's wrong with this code?
nothing is happening when I click the slot
Function code:
Code that executes when certain slot is clicked:
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)