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 Block place on location dont work

Discussion in 'Skript' started by Brok3nmind, Jan 18, 2019.

Thread Status:
Not open for further replies.
  1. Brok3nmind

    Brok3nmind Active Member

    Joined:
    Feb 3, 2017
    Messages:
    66
    Likes Received:
    1
    Minecraft ver. 1.13.2 (Spigot)
    Skript: Skript bensku-2.3.1

    Why this dont work D:
    There are no errors and i think "if location of clicked block is {loc.test}:" is the Problem
    Code (Skript):
    1. on Load:
    2.     set {loc.test} to the location at -524, 94, -85 in world "Survival1"
    3.  
    4. on rightclick:
    5.     if clicked block is button:
    6.         if location of clicked block is {loc.test}:
    7.             play sound "ENTITY_ARROW_HIT" to player with volume 1 with pitch 5
    8.             send "&8[&6Casino&8] &aDu hast eine Runde im Casino für &2100 Taler &agekauft" to event-player
    9.             wait 2 seconds
    10.             play sound "ENTITY_PLAYER_LEVELUP" to player with volume 0.7 with pitch 5
    11.             play sound "BLOCK_NOTE_BLOCK_HARP" to player with volume 1 with pitch 5
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    I think locations from blocks return extra 0.5 (so -362.5, 48.5, 427.5 for example). You should take that into account
     
  3. Brok3nmind

    Brok3nmind Active Member

    Joined:
    Feb 3, 2017
    Messages:
    66
    Likes Received:
    1
    I already tried that but i also dont work
     
  4. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    Have you also tried clicking the blocks around it? Because I'm not sure which block it will be exactly
     
  5. Brok3nmind

    Brok3nmind Active Member

    Joined:
    Feb 3, 2017
    Messages:
    66
    Likes Received:
    1
    Yes i also did it
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    Positions of blocks are weird, and positions of buttons are even weirder
    Your best bet is to debug, to find the location of the clicked button
    something like this:
    Code (Skript):
    1. on Load:
    2.     set {loc.test} to the location at -524, 94, -85 in world "Survival1"
    3.  
    4. on right click:
    5.     if clicked block is a button:
    6.         send "Button Loc: %location of clicked block%"
    7.         send "Stored Loc: %{loc.test}%"
    This way you can compare the outcome from the actual location of the clicked block to the stored location
     
    • Like Like x 1
  7. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Why don’t you just set the variable to the clicked block instead of typing the coordinates manually
     
  8. Brok3nmind

    Brok3nmind Active Member

    Joined:
    Feb 3, 2017
    Messages:
    66
    Likes Received:
    1
    because i already did it, and it dont work
    --- Double Post Merged, Jan 18, 2019, Original Post Date: Jan 18, 2019 ---
    Thanks
     
Thread Status:
Not open for further replies.

Share This Page

Loading...