Skript Help

Status
This thread has been locked.

Brennon

Premium
Feedback score
3
Posts
90
Reactions
14
Resources
0
Hello, I need help creating a skript and I cant seem to wrap my head around on how to do this.

So, I need to be able to allow players to mine a wooden log with a shovel multiple times. Example; First time mined; block is 1/3 broken, Second time mined; block is 2/3 broken, Third time mined; 4 logs is given to the player and the tree "fully breaks"
 

Hybernates

Hi
Premium
Feedback score
0
Posts
36
Reactions
11
Resources
2
Okay, so since breaking a log is an event, you could do something like:
---

variables:
{delay.%player%} = 0

on break of log:
if {delay.%player%} is 0:
set {delay.%player%} to 1
cancel event
if {delay.%player%} is 1:
set {delay.%player%} to 2
cancel event
if {delay.%player%} is 2:
set {delay.%player%} to 3
cancel event
if {delay.%player%} is 3:
cancel event
give 4 logs to the player
stop

---
I can't guarantee this will work, but it is a template to mess around with.
Let me know if you need help.
 

Brennon

Premium
Feedback score
3
Posts
90
Reactions
14
Resources
0
Okay, so since breaking a log is an event, you could do something like:
---

variables:
{delay.%player%} = 0

on break of log:
if {delay.%player%} is 0:
set {delay.%player%} to 1
cancel event
if {delay.%player%} is 1:
set {delay.%player%} to 2
cancel event
if {delay.%player%} is 2:
set {delay.%player%} to 3
cancel event
if {delay.%player%} is 3:
cancel event
give 4 logs to the player
stop

---
I can't guarantee this will work, but it is a template to mess around with.
Let me know if you need help.
Will test it when I have a chance. Thanks for the help
Just learn Java.





Kappa
Laptop isn't able to run all the applications to not crash etc. Would like to learn it in the future though
 

Brennon

Premium
Feedback score
3
Posts
90
Reactions
14
Resources
0
Okay, so since breaking a log is an event, you could do something like:
---

variables:
{delay.%player%} = 0

on break of log:
if {delay.%player%} is 0:
set {delay.%player%} to 1
cancel event
if {delay.%player%} is 1:
set {delay.%player%} to 2
cancel event
if {delay.%player%} is 2:
set {delay.%player%} to 3
cancel event
if {delay.%player%} is 3:
cancel event
give 4 logs to the player
stop

---
I can't guarantee this will work, but it is a template to mess around with.
Let me know if you need help.
This is what I ended up with, can;t seem to get leaves to disappear but for logs:

Code:
on join:
    if {delay.%player%} is not set:
        set {delay.%player%} to 0
        
aliases:
    wood1 = oak log
    leaves1 = oak leaves
    
on break of log:
    if {delay.%player%} is 0:
        set {delay.%player%} to 1
        cancel event
        message "&725%% Mined"
        stop
    if {delay.%player%} is 1:
        set {delay.%player%} to 2
        cancel event
        message "&750%% Mined"
        stop
    if {delay.%player%} is 2:
        set {delay.%player%} to 3
        cancel event
        message "&775%% Mined"
        stop
    if {delay.%player%} is 3:
        cancel event
        give 4 oak log to the player
        set {delay.%player%} to 0
        message "&7Mining Completed"
        loop blocks upwards:
            loop-block is wood1:
                set the loop-block-1 to air
        loop blocks downwards:
            loop-block is wood1:
                set the loop-block-1 to air
        stop

Thank you for helping
 
Status
This thread has been locked.
Top