Solved How to make event inside event condition?

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

eskaerpe

Member
Jul 10, 2021
2
0
1
24
This skript i made is for skyblock/acid server and used for the plugin called
CustomOreGen
I want to make a skript like this, if player break any ore and more than 25 blocks, the 26th block will set to bedrock. If the player trying to break that bedrock, it will send messages "Dont, AFK! Please wait 5 seconds.." then back random ore again.

here's my code

Code:
options:
    oreCounter : 0
on mine any ore:
    add 1 to {oreCounter}
    send "%player% Mine ore for %{ore Counter}%" to player
    if player is in "world":
        if {oreCounter} > 25:
            cancel event
            set block to bedrock
            wait 1 second
            on block damaging is bedrock:
            # I am stuck here, I can't make the event condition
                send "&cDon't AFK! &fplease stay for 5 second before you continue to mining"
            wait 5 second
            set block to coal ore
            set {coalCounter} to 0
            send "&aOk thanks for not AFK"
        wait 1 tick
        #drop 1 coal
        add 2 to the spawned experience

Help me please, thank you!
 
there are multiple errors with this script

1. If you want it to make player specific change, the following:
Code:
{oreCounter}
to
Code:
{oreCounter::%player%}

2. There is an event in an event

3. You keep changing the variable name

This would be the right code, hopefully
Code:
on unload:
    delete {oreCounter::*}
    delete {cancelOre::*}
    delete {hitBedrock::*}

on mine of any ore:
    if player is in world "world":
        add 1 to {oreCounter::%player%}
        if {oreCounter::%player%} is more than 25:
            cancel event
            set {cancelOre::%player%} to true
            set block at event-block to bedrock
            wait 5 seconds
            if {hitBedrock::%player%} is not true:
                send "&aOk thanks for not being AFK"
            set block at event-block to coal ore
            delete {oreCounter::%player%}
            delete {cancelOre::%player%}


on block damaging is bedrock:
    if {cancelOre::%player%} is true:
        set {hitBedrock::%player%} to true
        send "&cDon't AFK! &fplease stay for 5 second before you continue to mining"
 
So the {oreCounter::%player%} variable that you make is for count the ore his mine every one player?
 
Status
Not open for further replies.