on break command

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

NandoGaming_420

New Member
May 5, 2020
9
0
1
23
on break:
cancel event
send "&cYou have been hit by a &6Block &cyou need to wait 15 seconds to break again."
wait 15 seconds
send "&cYou have can now break again!"
stop

but after 15 seconds i can't still not break. Can someone help me with this

Version of skript: 2.2
 
on break:
cancel event
send "&cYou have been hit by a &6Block &cyou need to wait 15 seconds to break again."
wait 15 seconds
send "&cYou have can now break again!"
stop

but after 15 seconds i can't still not break. Can someone help me with this

Version of skript: 2.2
Uhm. I dont know if this is that you want:
code_language.skript:
on break:
    if {time.%player%} is not set:
        set {time.%player%} to true
        wait 15 seconds 
        set {time.%player%} to false
    if {time%player%} is false:
        set {time.%player%} to true:
        wait 15 seconds
        set {time.%player%} to false
    if {time.%player%} is true:
        cancel event
        message "&cYou have been hit by &6Block&c you need to wait 15 seconds to break again." to event-player
I haven't tested it, so I dont know if it will work.
 
Hello it is not working i can still break things

And it needs to be like if i hit a player then the player cannot break again for 15 seconds
 
Hello it is not working i can still break things

And it needs to be like if i hit a player then the player cannot break again for 15 seconds
Then try:
code_language.skript:
on damage:
    victim is a player:
        attacker is a player:
            set {pvptime.%attacker%} to 15
            set {pvpstatus.%attacker%} to true
            while {pvpstatus.%attacker%} is set:
                wait a second
                remove 1 from {pvptime.%attacker%} 
                if {pvptime.%attacker%} is 0:
                    delete {pvptime.%attacker%} 
                    delete {pvpstatus.%attacker%}
                    stop
on damage:
    victim is a player:
        attacker is a player:
            set {pvptime.%victim%} to 15
            set {pvpstatus.%victim%} to true
            while {pvpstatus.%victim%} is set:
                wait a second
                remove 1 from {pvptime.%victim%} 
                if {pvptime.%victim%} is 0:
                    delete {pvptime.%victim%}
                    delete {pvpstatus.%victim%}
                    stop

on break:
    if {pvpstatus.%player%} is set:
        cancel event
        send "&cYou cannot break while you're in pvp." to player
 
Okay thanks but i am getting a error because i want to hit the player with a item with the name &6Exotic Bone but the if i want to put it there it is giving me a error with the lines. And i want to add the cooldown onto it

So it is like this

Cooldown code:
command /bonecooldown:
trigger:
set {_waited} to difference between {bonecooldown.%player%.lastused} and now
if {_waited} is less than 30 seconds:
message "&6&lExotic Bone &cis on cooldown for %difference between 30 seconds and {_waited}%" to player
stop
message "&aYou hit &c%name of player% &awith a &6&lExotic Bone!" to player
set {bonecooldown.%player%.lastused} to now

Code of the Bone:

on damage:
victim is a player:
attacker is a player:
if colored name of attacker's tool is "&6Exotic Bone":
set {pvptime.%attacker%} to 15
set {pvpstatus.%attacker%} to true
while {pvpstatus.%attacker%} is set:
wait a second
remove 1 from {pvptime.%attacker%}
if {pvptime.%attacker%} is 0:
delete {pvptime.%attacker%}
delete {pvpstatus.%attacker%}
stop

But were do i need to add like the: make player execute command "/bonecooldown"
 
use code formatting when sending code
upload_2020-5-7_9-23-31-png.4632
 
use code formatting when sending code
upload_2020-5-7_9-23-31-png.4632
Okay i will send it in a code format
[doublepost=1588851334,1588851180][/doublepost]Okay thanks but i am getting a error because i want to hit the player with a item with the name &6Exotic Bone but the if i want to put it there it is giving me a error with the lines. And i want to add the cooldown onto it

So it is like this

Cooldown code:
Code:
command /bonecooldown:

    trigger:
        set {_waited} to difference between {bonecooldown.%player%.lastused} and now
        if {_waited} is less than 30 seconds:
            message "&6&lExotic Bone &cis on cooldown for %difference between 30 seconds and {_waited}%" to player
            stop
        message "&aYou hit &c%name of player% &awith a &6&lExotic Bone!" to player
        set {bonecooldown.%player%.lastused} to now

Code:
on damage:
    victim is a player:
        attacker is a player:
            if colored name of attacker's tool is "&6Exotic Bone":
            make player execute command "/bonecooldown"
            set {pvptime.%attacker%} to 15
            set {pvpstatus.%attacker%} to true
            while {pvpstatus.%attacker%} is set:
                wait a second
                remove 1 from {pvptime.%attacker%}
                if {pvptime.%attacker%} is 0:
                    delete {pvptime.%attacker%}
                    delete {pvpstatus.%attacker%}
                    stop

But were do i need to add like the: make player execute command "/bonecooldown" And i got a error of space's in this text if colored name of attacker's tool is "&6Exotic Bone":
 
Should work now, you needed to indent line 5 and onwards because of the colon on line 4, and you needed to change "make player" to "make attacker". Hope i helped ;p

Code:
on damage:
    victim is a player:
        attacker is a player:
            if colored name of attacker's tool is "&6Exotic Bone":
                make attacker execute command "/bonecooldown"
                set {pvptime.%attacker%} to 15
                set {pvpstatus.%attacker%} to true
                while {pvpstatus.%attacker%} is set:
                    wait a second
                    remove 1 from {pvptime.%attacker%}
                    if {pvptime.%attacker%} is 0:
                        delete {pvptime.%attacker%}
                        delete {pvpstatus.%attacker%}
                        stop
 
Should work now, you needed to indent line 5 and onwards because of the colon on line 4, and you needed to change "make player" to "make attacker". Hope i helped ;p

Code:
on damage:
    victim is a player:
        attacker is a player:
            if colored name of attacker's tool is "&6Exotic Bone":
                make attacker execute command "/bonecooldown"
                set {pvptime.%attacker%} to 15
                set {pvpstatus.%attacker%} to true
                while {pvpstatus.%attacker%} is set:
                    wait a second
                    remove 1 from {pvptime.%attacker%}
                    if {pvptime.%attacker%} is 0:
                        delete {pvptime.%attacker%}
                        delete {pvpstatus.%attacker%}
                        stop
Okay but now if i pearl i am getting damage. So then the code will also work on enderpearls. But i dont need that how can i fix that
 
Status
Not open for further replies.