Solved Block place on location dont work

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

Brok3nmind

Active Member
Feb 3, 2017
66
1
8
22
Germany
darkvoid.eu
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_language.skript:
on Load:
    set {loc.test} to the location at -524, 94, -85 in world "Survival1"
 
on rightclick:
    if clicked block is button:
        if location of clicked block is {loc.test}:
            play sound "ENTITY_ARROW_HIT" to player with volume 1 with pitch 5
            send "&8[&6Casino&8] &aDu hast eine Runde im Casino für &2100 Taler &agekauft" to event-player
            wait 2 seconds
            play sound "ENTITY_PLAYER_LEVELUP" to player with volume 0.7 with pitch 5
            play sound "BLOCK_NOTE_BLOCK_HARP" to player with volume 1 with pitch 5
 
I think locations from blocks return extra 0.5 (so -362.5, 48.5, 427.5 for example). You should take that into account
 
Have you also tried clicking the blocks around it? Because I'm not sure which block it will be exactly
 
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_language.skript:
on Load:
    set {loc.test} to the location at -524, 94, -85 in world "Survival1"

on right click:
    if clicked block is a button:
        send "Button Loc: %location of clicked block%"
        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
Reactions: Brok3nmind
Why don’t you just set the variable to the clicked block instead of typing the coordinates manually
 
Why don’t you just set the variable to the clicked block instead of typing the coordinates manually
because i already did it, and it dont work
[doublepost=1547830505,1547829973][/doublepost]
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_language.skript:
on Load:
    set {loc.test} to the location at -524, 94, -85 in world "Survival1"

on right click:
    if clicked block is a button:
        send "Button Loc: %location of clicked block%"
        send "Stored Loc: %{loc.test}%"

This way you can compare the outcome from the actual location of the clicked block to the stored location
Thanks
 
Status
Not open for further replies.