Solved Event-block is not working in a variable

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

IsntZ

Member
Jun 15, 2022
23
0
1
23
I want to use event-block in a gui and it wasn't working so i tried to make a test skript
when i did:

on left click on beacon:
set {_block} to event-block
set {_p} to player
if {_block} is beacon:
if {gens::%player's uuid%::beacon::*} contains location of {_block}:
play sound "entity.item.pickup" with volume 3 to the player
close player's inventory
remove 1 from {gc::%player's uuid%}
log "%player% picked up %{block.%player%}% generator at (%location of {block.%player%}%)" to "gens.log"
set {_block} to air
console command "givegen beacon %{_p}% 1"
send action bar " &7You picked up your gen!" to player
remove location of {_block} from {gens::%player's uuid%::beacon::*}

it didnt work
but when i did:

on left click on beacon:
set {_block} to event-block
set {_p} to player
if {_block} is beacon:
if {gens::%player's uuid%::beacon::*} contains location of event-block:
play sound "entity.item.pickup" with volume 3 to the player
close player's inventory
remove 1 from {gc::%player's uuid%}
log "%player% picked up %{block.%player%}% generator at (%location of {block.%player%}%)" to "gens.log"
set event-block to air
console command "givegen beacon %{_p}% 1"
send action bar " &7You picked up your gen!" to player
remove location of event-block from {gens::%player's uuid%::beacon::*}

it worked
 
set {_block} to event-block

should be like
set {_block} to location of event-block

or something like that
 
in the line:
set {_block} to air
and the line:
if {_block} is beacon:

it neens to be a block
 
Just for testing
[doublepost=1658345006,1658327130][/doublepost]I fixed it by doing: "set {_block} to event-block's location" and using: "block at {_block}"
 
Status
Not open for further replies.