I made a scoreboard, but the coins are for every one need. It try to explain my problem when i give player 1 $1000 and player 2 $100 will the scoreboard show $1000 for everyone how can i fix this ? but when i type the command /coins will that show the right ammount of money
Scoreboard:
Money Skript:
Scoreboard:
code_language.skript:
function Scoreboard(p: player):
wipe {_p}'s sidebar
set name of sidebar of {_p} to "&6&lCreepCraft&8.&6&lnet"
set score "&6Server&8:" in sidebar of {_p} to 11
set score "&a%{_p}'s world%" in sidebar of {_p} to 10
set score "&2" in sidebar of {_p} to 9
set score "&bOnline&8:" in sidebar of {_p} to 8
set score "%number of all players% / 1500" in sidebar of {_p} to 7
set score "&1" in sidebar of {_p} to 6
set score "&eCoins&8:" in sidebar of {_p} to 5
set score "&a$%{coins::%{_p}%}%" in sidebar of {_p} to 4
set score "&0" in sidebar of {_p} to 3
set score "&3Shop&8:" in sidebar of {_p} to 2
set score "&fCreepCraft.net" in sidebar of {_p} to 1
on join:
wait 4 ticks
Scoreboard(player)
on load:
loop all players:
Scoreboard(loop-player)
code_language.skript:
#Money
options:
noperms: &8[&eMoney&8] &cYou don't have enough permissions.
variables:
{money.%player%} = 0
every 3 ticks:
loop all players:
if {money.%loop-player%} > 1000000000:
set {money.%loop-player%} to 1000000000
send "&6&lSystem&8: &7You can't have more than &a$1000000000" to loop-player
command /coins [<text>] [<offlineplayer>] [<integer>]:
aliases: money, balance
trigger:
if arg-1 is not set:
send "&6&lSystem&8: &7You have &a$%{money.%player%}%"
stop
if player has permission "modify.coins":
if arg-1 is "remove":
if arg 2 is set:
if arg 3 is set:
if arg 3 is 0:
send "&6&lSystem&8: &7You can't remove &2%arg-2% &a$0" to sender
else:
remove arg 3 from {money.%arg 2%}
send "&6&lSystem&8: &7You removed &a$%arg 3% from &2%arg 2%" to sender
send "&6&lSystem&8: &7Your account balance has been reduced by &a$%arg 3%" to arg-2
stop
else:
send "&6&lSystem&8: &7/Coins remove &7player &cammount"
else:
send "&6&lSystem&8: &7/Coins remove &cplayer &7ammount"
if arg-1 is "add":
if arg 2 is set:
if arg 3 is set:
if arg 3 is 0:
send "&6&lSystem&8: &7You can't give &2%arg-2% &a$0" to sender
else:
add arg 3 to {money.%arg 2%}
send "&6&lSystem&8: &7You added &a$%arg 3% &7to &2%arg 2%" to sender
send "&6&lSystem&8: &7You became &a$%arg 3% &7your new balance is &a$%{money.%arg-2%}%" to arg-2
stop
else:
send "&6&lSystem&8: &7/Coins add &7player &cammount"
else:
send "&6&lSystem&8: &7/Coins ad &cplayer &7ammount"
if arg-1 is "set":
if arg 2 is set:
if arg 3 is set:
set {money.%arg 2%} to arg 3
send "&6&lSystem&8: &7You have set the money from &2%arg 2% &7to &a$%arg 3%&7." to sender
send "&6&lSystem&8: &7Your balance has been set to &a$%{money.%arg-2%}%" to arg-2
stop
else:
send "&6&lSystem&8: &7/Coins set &7player &cammount"
else:
send "&6&lSystem&8: &7/Coins set &cplayer &7ammount"
if arg-1 is "delete":
if arg 2 is set:
set {money.%arg 2%} to 0
send "&6&lSystem&8: &7You have set the money from &2%arg 2% &7to &a$%arg 3%&7." to sender
send "&6&lSystem&8: &7Your balance has been set to &a$%{money.%arg-2%}%" to arg-2
stop
else:
send "&6&lSystem&8: &7/Coins &7delete &cplay"
else:
send "&6&lSystem&8: &cYou don't have the permission" to sender
#command /pay [<player>] [<integer>]:
# trigger:
# if arg 1 is not set:
# send "&6&lSystem&8: &cUsage: /pay <player> <amount>" to sender
# stop
# if arg 1 is "%sender%":
# send "&6&lSystem&8: &cYou can not send yourself money." to sender
# stop
# if arg 2 is not set:
# send "&6&lSystem&8: &cUsage: /pay <player> <amount>" to sender
# stop
# if arg 2 is set:
# if arg 2 is less than 1:
# send "&6&lSystem&8: &cYou can not send less than 0 money to someone." to sender
# if arg 2 is bigger than 0:
# if arg 2 is less than {money.%sender%} +1:
# add arg 2 to {money.%arg 1%}
# remove arg 2 from {money.%sender%}
# send "&6&lSystem&8: &7You have paid &c%arg 1% $%arg 2%&7." to sender
# send "&6&lSystem&8: &c%sender% &7has paid you &c$%arg 2%&7." to arg 1
# else:
# send "&6&lSystem&8: &cYou can not send more money to someone like you." to sender