Solved pls help <3 thx

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

_Lasagna

Member
Apr 9, 2018
4
0
0
20
code_language.skript:
on rightclick:
    if name of held item of player is "<gold>1* Wheat":
        if player is sneaking:
            add (3 * the number of wheat in inventory named "<gold>1* Wheat") to player's account
            remove (number of wheat in inventory named "<gold>1* Wheat") from player
            send "<lime>You now have: <gold>%player's money%" to player

        if player is not sneaking:
            remove 1 of player's tool from player # removes item
            add 3 to player's account
            send "<lime>You now have: <gold>%player's money%" to player

I seem to be having issues with this, i'm assuming its because of the fact that it cant read names or i'm phrasing it wrong. I'm really new to skript. thanks for you're help
 
What is your issue? Errors? Problems? Expecting it to do something and its doing something else?
You need to put info on your problem so people can help you.
 
Well, it'll pass the sneaking condition and send the message. But it will not add the currency or remove all the wheat named ""1* Wheat" from the inventory
 
try something like
set {_wheat} to the number of wheat in inventory named "<gold>1* Wheat"
set {_wheat2} to {_wheat} * 3
add {_wheat2} to the player's account
[doublepost=1523304304,1523303724][/doublepost]Actually try this instead
I ran it in console, no errors, but i haven't ran it in a game
You will have to test that and see if it works

code_language.skript:
on rightclick:
    if name of held item of player is "<gold>1* Wheat":
        if player is sneaking:
            set {_wheat} to wheat named "<gold>1* Wheat"
            set {_amountofwheat} to the number of {_wheat} in the player's inventory
            set {_wheat3} to {_amountofwheat} * 3
            add {_wheat3} to player's account
            remove all {_wheat} from player
            send "<lime>You now have: <gold>%player's money%" to player

        if player is not sneaking:
            remove 1 of player's tool from player # removes item
            add 3 to player's account
            send "<lime>You now have: <gold>%player's money%" to player

EDIT:
I tested it in game and it works like a charm
 
Status
Not open for further replies.