Solved Announcement 1000 gold

  • 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!

Feb 26, 2019
29
0
1
23
Category: automatic system to announce a broadcast

Suggested name: i don't care

What I want: i want a script where the broadcast will say (playername) got 1000 gold! i use this skript:
on first join:
set {gold.%player%} to 0
on right click on gold block:
play sound "" with volume 10 at player
send player title "&e&lGold" with subtitle "&8&l» &3&l%{gold.%player%}%" for 0.2 seconds
add 1 to {gold.%player%}
#
command /gold [<offline player>]:
executable by: players
trigger:
if argument 1 is not set:
send " "
send "&6&lGold &8» &2&l%{gold.%player%}%"
send " "
Else:
send " "
send "&6&lGold &8» &2&l%{gold.%arg-1%}%"
send " "


Ideas for commands: automatic so no command

Ideas for permissions: no permission

When I'd like it by: as fast as possible
 
Last edited:
Use if {gold.%player%} >= 1000. Also, I recommend using list variables ({gold::%player%}) because you can loop them and delete them more easily.
 
Code:
on first join:
    set {gold::%player%} to 0
on right click on gold block:
    play sound "" with volume 10 at player
    send player title "&e&lGold" with subtitle "&8&l» &3&l%{gold::%player%}%" for 0.2 seconds
    add 1 to {gold::%player%}
    {gold::%player%} >= 1000
    broadcast "%player% has got 1000 gold"
#
command /gold [<offline player>]:
    executable by: players
    trigger:
        if arg- is not set:
            send " "
            send "&6&lGold &8» &2&l%{gold::%player%}%"
            send " "
        else:
            send " "
            send "&6&lGold &8» &2&l%{gold::%arg-1%}%"
            send " "
 
Code:
on first join:
    set {gold::%player%} to 0
on right click on gold block:
    play sound "" with volume 10 at player
    send player title "&e&lGold" with subtitle "&8&l» &3&l%{gold::%player%}%" for 0.2 seconds
    add 1 to {gold::%player%}
    {gold::%player%} >= 1000
    broadcast "%player% has got 1000 gold"
#
command /gold [<offline player>]:
    executable by: players
    trigger:
        if arg- is not set:
            send " "
            send "&6&lGold &8» &2&l%{gold::%player%}%"
            send " "
        else:
            send " "
            send "&6&lGold &8» &2&l%{gold::%arg-1%}%"
            send " "
Thanks so much but do you also know how to make it so it only broadcasts it once? because when a player gets + 1 gold it will broadcast it again.
 
Try
Code:
on first join:
    set {gold::%player%} to 0
on right click on gold block:
    play sound "" with volume 10 at player
    send player title "&e&lGold" with subtitle "&8&l» &3&l%{gold::%player%}%" for 0.2 seconds
    add 1 to {gold::%player%}
    {gold::%player%} >= 1000
    {goldbroadcast::%player%} is not set
    set {goldbroadcast::%player%} to true
    broadcast "%player% has got 1000 gold"
#
command /gold [<offline player>]:
    executable by: players
    trigger:
        if arg- is not set:
            send " "
            send "&6&lGold &8» &2&l%{gold::%player%}%"
            send " "
        else:
            send " "
            send "&6&lGold &8» &2&l%{gold::%arg-1%}%"
            send " "
[doublepost=1551371840,1551371777][/doublepost]Btw you should also use UUIDs because now, when a player changes their name, they lose their gold