1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Need help with how to keep track of how many blocks a player has picked up since they joined.

Discussion in 'Skript' started by JadeInnit1, Oct 5, 2022.

  1. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Ok so here is a bit of context. I am trying to make a skript that will teleport you to a certain set of coordinates once you've mined X amount of dirt or stone or whatever it is in the future. At this point in time, I need it to be for dirt.

    2.6.3
    Skript author: Me, Quiettee
    1.19.2
    Code (Text):
    1.  
    2. variables:
    3.     {dirtcount} = 0
    4.  
    5. on pickup of dirt:
    6.     add 1 to {DirtCount}
    7.    
    8. if {dirtcount} = 5
    9.     teleport %uuid of player% to 280981 164 48866
    10.  
    11.  
    The errors I am getting on reload are
    1. Line 8, Indentation error: Expected 0 tabs but found 1 tab.
    2: Line 7: Invalid line - all code has to be put into triggers

    All help is appreciated!
     
  2. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    138
    Likes Received:
    22
    For the first: your's code need to be put into spefic trigger, like as event, for that you have errors on line 7-8
    Lets next, if you wanna assign some variable with player - use 'uuid of player' inside variable name.
    Teleport effect's inputs is Entity and Location, you are using uuid instead of entity and something unspeficed as Location.
    Please, read some scripting guides on forum

    Fixed code:
    Code (Text):
    1. on pickup of dirt:
    2.     add 1 to {-p::%uuid of player%::dirtCount}
    3.  
    4.     if {-p::%uuid of player%::dirtCount} is 5:
    5.          teleport player to location 280981, 164, 48866
     
  3. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Thanks Iotzy, You came in clutch again!
     
    • Friendly Friendly x 1

Share This Page

Loading...