Custom heads in lucky blocks

  • 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 community!

    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.

kamziksvk

Member
Jul 1, 2018
2
0
1
Hello guys,

I am creating a custom script for lucky blocks, but I DONT WANT TO use a sponges like other skripts. I would like to use a luckyblock named luckyblock with a skull of player "luck". I have tried various of options but I didnt suceeded. Any ideas?

Currently I am using for testing:

Code:
on break of sponge: 
    cancel event
    set event-block to air

and for the GUI:

Code:
    format slot 2 of player with ("luck" parsed as offline player)'s skull named "&eLuckyBlock"

Any ideas how to do it guys? :emoji_slight_smile: Thank you in advance
 
1. Check if the player's tool is a "Lucky Block"
2. Set a variable for that location, for example {block.luckyblock::%location of event-block%} to true
3. When you break the block at that location, it checks if the variable is true. If so, execute your lucky block event.

If possible, the simplest way to do this is probably to find a way to check for the name of the skull of the broken block.

But.... since I am lazy and cba to make it a skull (You can simply just check for the name), I will be using sponge for this code demonstration.

code_language.skript:
command /luckyblocks [<integer>] [<text>]:
    permission: luckyblocks.admin
    trigger:
        if arg 1 is set:
            if arg 1 is greater than 1000:
                stop
            loop arg 1 times:
                add 1 sponge with name "&eLucky Block" with lore "&7???" to player
            message "&eReceived &7%arg 1%x &fLucky Blocks&e."
        if arg 1 is not set:
            message "&e/luckyblocks <amt>"

on place:
    if player's tool is sponge with name "&eLucky Block" with lore "&7???":
        set {block.luckyblock::%event-block's location%} to true

on break:
    #Checker
    if {block.luckyblock::%event-block's location%} is true:
        if event-block is not sponge or floor head:
            set {block.luckyblock::%event-block's location%} to false
    #Main Concept
    if {block.luckyblock::%event-block's location%} is true:
        set {_Random} to a random integer between 0 and 3
        if {_Random} is 0 or 1:
            drop 10 diamonds at event-block
        if {_Random} is 2:
            drop 10 emeralds at event-block
        if {_Random} is 3:
            drop 10 coal at event-block
            message "&4UNLUCKY LOLOLOLOL"
        set {block.luckyblock::%event-block's location%} to false
 
I have tried to take and rewrite the skript of other author, cause my skript was not working, the problem is that I am unable to get a correct valid headtype there: https://pastebin.com/G0HRujwT

Your skript is fine, but the main problem is, that I cant resolve the "head problem" instead of sponge :emoji_frowning:
 
Status
Not open for further replies.