I have tried to use functions for the first time, by making an economy skript, but it does not work. Whenever I try to type my /money command then proceed by typing /bal, my balance is <none> and I also don't get the message that is supposed to send in the addMoney function.
[doublepost=1581216904,1581211877][/doublepost]bump
[doublepost=1581218137][/doublepost]I updated the skript a bit because I found some errors, so here it is. I still have the same issues though
[doublepost=1581218517][/doublepost]Well, I was being dumb and was ignoring the errors and idk why. LMAO
Its fixed
Code:
options:
feedback: &b&lGrinder &3&lFarms &f»&r
function addMoney(p: player , m: number):
add {_m} to {money::%{_p}%}
send "%{_p}% %{_m}%" to {_p}
function removeMoney(p: player , m: number):
if {_m} is less than {money::%player%}:
subtract {_m} from {money::%{_p}%}
if {_m} is greater than {money::%player%}:
send "" to {_p}
send "{@feedback}&b You &3Don't&b Have Enough &3Money&b!" to {_p}
send "" to {_p}
command /money [<player>] [<text>] [<text>]:
trigger:
if arg-1 is set:
if arg-2 is "add":
if arg-3 is an integer:
function addMoney(arg-1,arg-3)
command /bal:
trigger:
message ""
message "{@feedback}&b Your Balance is &3%{money::%player%}%"
message ""
[doublepost=1581218137][/doublepost]I updated the skript a bit because I found some errors, so here it is. I still have the same issues though
Code:
options:
feedback: &b&lGrinder &3&lFarms &f»&r
function addMoney(p: player, m: number):
add {_m} to {money::%{_p}%}
broadcast "%{_p}% %{_m}%"
function removeMoney(p: player, m: number):
if {_m} is less than {money::%player%}:
subtract {_m} from {money::%{_p}%}
if {_m} is greater than {money::%player%}:
send "" to {_p}
send "{@feedback}&b You &3Don't&b Have Enough &3Money&b!" to {_p}
send "" to {_p}
command /money [<player>] [<text>] [<text>]:
trigger:
if arg-1 is set:
if arg-2 is "add":
addMoney(arg-1, arg-3)
command /bal:
trigger:
message ""
message "{@feedback}&b Your Balance is &3%{money::%player%}%"
message ""
Its fixed