Solved Coins

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

CuzImEinhorn

Member
Mar 17, 2017
15
0
1
31
How do i ask a Player how many coins he has?
code_language.skript:
if arg 1 is set:
    if {coins.%arg-1%} is 2500 (or higher):
 
Oh, yes.
Thanks.
[doublepost=1489860430,1489860201][/doublepost]But its makered as false. "'{coins.%arg-1%} is' is not an entity type"
code_language.skript:
    if arg 1 is set:
        if arg 1 is set:
            if {coins.%arg-1%} is >= 2500:
                send "&6Lobby &8>> &6You dont have enough coins for this!" to arg 1
 
Oh, yes.
Thanks.
[doublepost=1489860430,1489860201][/doublepost]But its makered as false. "'{coins.%arg-1%} is' is not an entity type"
code_language.skript:
    if arg 1 is set:
        if arg 1 is set:
            if {coins.%arg-1%} is >= 2500:
                send "&6Lobby &8>> &6You dont have enough coins for this!" to arg 1

Can we see all the code?
 
code_language.skript:
Coins:
on first join:
    set {coins.%player%} to 0
    stop
command /coins:
    trigger:
        send "&8[&6Coins&8] &fDeine Coins: &6%{coins.%player%}%"
        stop
command /givecoins [<player>] [<text>]:
    trigger:
        if player has permission "admin.givecoins":
            if arg 1 is not set:
                send "&8[&6Coins&8] &cDu musst einen Spieler angeben!"
                stop
            if arg 2 is not set:
                send "&8[&6Coins&8] &cDu musst einen Betrag angeben!"
                stop
            if arg 1 is player:
                send "&8[&6Coins&8] &cDu hast &6%arg-1% %arg-2% &cCoins gegeben!" to player
                send "&8[&6Coins&8] &cDir wurden &6%arg-2% &cCoins von &6%sender% &cgegeben!" to arg 1
                add arg 2 to {coins.%arg-1%}
                stop
        else:
            send "&8[&6Coins&8] &cDu darfst diesen Befehl &4&lNICHT &cbenutzen!"
            stop

buy-system:
command /5luckyblock [<player>]:
    trigger:
        if player has permission "Lucky.give":
            if arg 1 is not set:
                send "&6LuckyFFA &8>> &cDu musst einen Spieler angeben!"
                stop
            if arg 1 is set:
                    if {coins.%player%} is >= 2500:
                        send "&6LuckyFFa &8>> &cDu hast nicht genug Coins dazu" to arg 1
Sry, its german xd
 
code_language.skript:
Coins:
on first join:
    set {coins.%player%} to 0
    stop
command /coins:
    trigger:
        send "&8[&6Coins&8] &fDeine Coins: &6%{coins.%player%}%"
        stop
command /givecoins [<player>] [<text>]:
    trigger:
        if player has permission "admin.givecoins":
            if arg 1 is not set:
                send "&8[&6Coins&8] &cDu musst einen Spieler angeben!"
                stop
            if arg 2 is not set:
                send "&8[&6Coins&8] &cDu musst einen Betrag angeben!"
                stop
            if arg 1 is player:
                send "&8[&6Coins&8] &cDu hast &6%arg-1% %arg-2% &cCoins gegeben!" to player
                send "&8[&6Coins&8] &cDir wurden &6%arg-2% &cCoins von &6%sender% &cgegeben!" to arg 1
                add arg 2 to {coins.%arg-1%}
                stop
        else:
            send "&8[&6Coins&8] &cDu darfst diesen Befehl &4&lNICHT &cbenutzen!"
            stop

buy-system:
command /5luckyblock [<player>]:
    trigger:
        if player has permission "Lucky.give":
            if arg 1 is not set:
                send "&6LuckyFFA &8>> &cDu musst einen Spieler angeben!"
                stop
            if arg 1 is set:
                    if {coins.%player%} is >= 2500:
                        send "&6LuckyFFa &8>> &cDu hast nicht genug Coins dazu" to arg 1
Sry, its german xd

So , clear all your variables and change "[<text>]" with "[<number>] in the command.
In this way you should fix your problem.
 
nope.
Same Probleme.
I've got 2 Problems.
{coins.%player%} is' is not an entity type (ShopLuckyFFA2.sk, line 8: if {coins.%player%} is >= 2500:')
and when i make /givecoins, it does not add the coins to coins.
 
nope.
Same Probleme.
I've got 2 Problems.
{coins.%player%} is' is not an entity type (ShopLuckyFFA2.sk, line 8: if {coins.%player%} is >= 2500:')
and when i make /givecoins, it does not add the coins to coins.

code_language.skript:
on join:
    if {coins.%player%} isn't set:
        set {coins.%player%} to 0
        
command /givecoins [<player>] [<number>]:
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                add arg-2 to {coins.%player%} to 0
                
command /5luckyblock [<player>]:
    trigger:
        if arg-1 is set:
            if {coins.%player%} is more or equal than 2500:
                remove 2500 from {coins.%player%}
                message "&c&lTEST"
 
Im looking for this tomorrow.
Thanks for your Help!
But when im writing
add arg-2 to {coins.%player%} to 0
I think then im adding the amount to 0.
Does it work with an other amount too?
 
Im looking for this tomorrow.
Thanks for your Help!
But when im writing
add arg-2 to {coins.%player%} to 0
I add the amount to 0.
Does it work too with an other amount?

That doesn't exist
code_language.skript:
add arg-2 to {coins.%player%} to 0

You can add/remove/set/delete/clear a variable.

Examples:
code_language.skript:
add 10 to {coins.%player%}
remove 10 from {coins.%player%}
set {coins.%player%} to 0
delete {coins.%player%}
clear {coins.%player%}
 
  • Like
Reactions: CuzImEinhorn
Status
Not open for further replies.