Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on join:
- if {credit::%player%} is not set:
- set {credit::%player%} to 0
- command /loan:
- trigger:
- if {loanalready::%{_p}%} is not set:
- set {loanamount::%player%} to 0
- set {days::%player%} to 0
- open virtual chest inventory with size 1 named "&e&lLoan" to player
- create a gui slot 0 of player with gray glass named "" to do nothing
- create a gui slot 1 of player with gray glass named "" to do nothing
- create a gui slot 2 of player with gray glass named "" to do nothing
- create a gui slot 4 of player with book named "&eLoan Money" with lore "&7Your credit: &a%{credit::%player%}%" to run function loans(player)
- create a gui slot 3 of player with paper named "&eInfo" with lore "&7How you can get your credit up||&7loan money and pay it back and your||&7credit will be better and you can loan more||&7Your credit can get better when you have||&7more money in your balance" to do nothing
- create a gui slot 6 of player with gray glass named "" to do nothing
- create a gui slot 7 of player with gray glass named "" to do nothing
- create a gui slot 8 of player with gray glass named "" to do nothing
- if {loan::%player%} is 10000:
- create a gui slot 5 of player with paper named "&eInfo" with lore "&7You can loan &a0-%{loan::%player%}%$" to do nothing
- else:
- message "&7You already have a loan pay it back with &a/payback"
- function loans(p: player):
- open virtual chest inventory with size 3 named "&e&lLoan Amount" to {_p}
- create a gui slot 9 of {_p} with green glass named "&e+&a100$" to run function add({_p}, 100)
- create a gui slot 10 of {_p} with green glass named "&e+&a1000$" to run function add({_p}, 1000)
- create a gui slot 11 of {_p} with green glass named "&e+&a10000$" to run function add({_p}, 10000)
- create a gui slot 12 of {_p} with green glass named "&e+&a100000$" to run function add({_p}, 100000)
- create a gui slot 13 of {_p} with book named "&e&lAmount" with lore "&7Loan Amount: &a%{loanamount::%{_p}%}%$" to run function amountloan({_p})
- create a gui slot 14 of {_p} with red glass named "&e-&c100000$" to run function remove({_p}, 100000)
- create a gui slot 15 of {_p} with red glass named "&e-&c10000$" to run function remove({_p}, 10000)
- create a gui slot 16 of {_p} with red glass named "&e-&c1000$" to run function remove({_p}, 1000)
- create a gui slot 17 of {_p} with red glass named "&e-&c100$" to run function remove({_p}, 100)
- create a gui slot 4 of {_p} with green glass named "&aLoan the max amount" to run function max({_p}, 100)
- create a gui slot 22 of {_p} with red glass named "&cReset the loan amount" to run function reset({_p})
- function max(p: player):
- if {credit::%{_p}%} is 0:
- set {loanamount::%{_p}%} to 10000
- create a gui slot 13 of {_p} with book named "&e&lAmount" with lore "&7Loan Amount: &a%{loanamount::%{_p}%}%$" to run function amountloan({_p})
- function reset(p: player):
- set {loanamount::%{_p}%} to 0
- create a gui slot 13 of {_p} with book named "&e&lAmount" with lore "&7Loan Amount: &a%{loanamount::%{_p}%}%$" to run function amountloan({_p})
- function add(p: player, n: integer):
- add {_n} to {loanamount::%{_p}%}
- create a gui slot 13 of {_p} with book named "&e&lAmount" with lore "&7Loan Amount: &a%{loanamount::%{_p}%}%$" to run function amountloan({_p})
- function remove(p: player, n: integer):
- if {loanamount::%{_p}%} is not less than 1:
- remove {_n} from {loanamount::%{_p}%}
- create a gui slot 13 of {_p} with book named "&e&lAmount" with lore "&7Loan Amount: &a%{loanamount::%{_p}%}%$" to run function amountloan({_p})
- else:
- message "&7You can't have a negative number" to {_p}
- function amountloan(p: player):
- set {days::%{_p}%} to 0
- if {credit::%{_p}%} is 0:
- if {loanamount::%{_p}%} is not higher than 10000:
- if {loanamount::%{_p}%} is not 0:
- days({_p})
- else:
- message "&7You can't loan &a0$" to {_p}
- else:
- message "&7You can only loan between &a0-%{loan::%{_p}%}%$" to {_p}
- message "&7Becuase your credit is &a%{credit::%{_p}%}%" to {_p}
- function days(P: player):
- open virtual chest inventory with size 3 named "&e&lDays" to {_p}
- create a gui slot 9 of {_p} with green glass named "&e+&a1 Days" to run function daysadd({_p}, 1)
- create a gui slot 10 of {_p} with green glass named "&e+&a2 Days" to run function daysadd({_p}, 2)
- create a gui slot 11 of {_p} with green glass named "&e+&a5 Days" to run function daysadd({_p}, 5)
- create a gui slot 12 of {_p} with green glass named "&e+&a10 Days" to run function daysadd({_p}, 10)
- create a gui slot 13 of {_p} with book named "&e&lDays" with lore "&7Days: &a%{days::%{_p}%}%" to run function confirmloan({_p})
- create a gui slot 14 of {_p} with red glass named "&e-&c10 Days" to run function daysremove({_p}, 10)
- create a gui slot 15 of {_p} with red glass named "&e-&c5 Days" to run function daysremove({_p}, 5)
- create a gui slot 16 of {_p} with red glass named "&e-&c2 Days" to run function daysremove({_p}, 2)
- create a gui slot 17 of {_p} with red glass named "&e-&c1 Days" to run function daysremove({_p}, 1)
- create a gui slot 4 of {_p} with green glass named "&aMax days" to run function maxdays({_p})
- create a gui slot 22 of {_p} with red glass named "&cReset the days amount" to run function resetdays({_p})
- function maxdays(p: player):
- if {credit::%{_p}%} is 0:
- set {days::%{_p}%} to 10
- create a gui slot 13 of {_p} with book named "&e&lDays" with lore "&7Days: &a%{days::%{_p}%}%" to run function confirmloan({_p})
- function resetdays(p: player):
- set {days::%{_p}%} to 0
- create a gui slot 13 of {_p} with book named "&e&lDays" with lore "&7Days: &a%{days::%{_p}%}%" to run function confirmloan({_p})
- function daysadd(p: player, n: integer):
- add {_n} to {days::%{_p}%}
- create a gui slot 13 of {_p} with book named "&e&lDays" with lore "&7Days: &a%{days::%{_p}%}%" to run function confirmloan({_p})
- function daysremove(p: player, n: integer):
- if {days::%{_p}%} is not 0:
- if {days::%{_p}%} is not less than 1:
- remove {_n} from {days::%{_p}%}
- create a gui slot 13 of {_p} with book named "&e&lDays" with lore "&7Days: &a%{days::%{_p}%}%" to run function confirmloan({_p})
- else:
- message "&7You can't have a negative number" to {_p}
- else:
- message "&7You can't loan &a0 days" to {_p}
- ########################
- # Loan System (need a better one)
- #######################
- function confirmloan(p: player):
- if {days::%{_p}%} is not higher than 10:
- open virtual chest inventory with size 3 named "&e&lConfirm loan" to {_p}
- create a gui slot 13 of {_p} with book named "&e&lConfirm" with lore "&7Amount: &a%{loanamount::%{_p}%}%$||&7Days: &a%{days::%{_p}%}%" to run function loanrun({_p})
- create a gui slot 4 of {_p} with red glass named "&CCancel" to close
- create a gui slot 22 of {_p} with red glass named "&CCancel" to close
- else:
- message "&7You can't loan more then &a10 &7days becuase your credit is &a%{credit::%{_p}%}%" to {_p}
- function loanrun(p: player):
- execute console command "eco give %player% %{loanamount::%{_p}%}%"
- set {loanalready::%{_p}%} to true
- message "&7You have loaned &a%{loanamount::%{_p}%}%" to {_p}
- message "&7You have to pay back in &a%{days::%{_p}%}%" to {_p}
- every 1 day:
- if {credit::%player%} is 0:
- if {days::%player%} is not 0:
- if {loanalready::%player%} is true:
- remove 1 from {days::%{_p}%}
- message "&7You now have &a%{days::%{_p}%}%" to player
- every 1 day:
- if {days::%player%} is less than 2:
- if {loanalready::%player%} is true:
- message "&7You have 1 day before you have to pay back" to player
- every 1 day:
- if {days::%player%} is 0:
- if {loanalready::%player%} is true:
- set {payback::%player%} to "%players balance%"
- remove {payback::%player%} from players balance
- message "Your balance has been removed becuase you didnt pay your loan"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement