Solved Help - Fortune with explosive

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

StarBen_

Member
Jun 21, 2019
4
0
0
25
I'm trying to make a explosive custom enchant that works with fortune, but it doesnt give me any blocks when i do it. Here's there skript:

on first join:
set {_fortune} to 1

on break:
if player can build at targeted block:
if lore of player's tool is "&4explosion":
create a fake explosion at targeted block
loop blocks in radius 1.8 around the targeted block:
give event-player {_fortune} parsed as a number of loop-block
set loop-block to air

0 Errors.
 
variables that start with an underscore are called "local variables", and they are local to the event they're created in, meaning, they won't work outside of that event.
Also, you shouldn't be using global variables, you should be using variables that distinguish the player, ie:
code_language.skript:
{fortune::%uuid of player%}
 
Status
Not open for further replies.