cancel event wont work

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

cemal

New Member
Oct 20, 2024
6
0
1
25
right click on player:
name of entity = "deneme"
if player has skull:
cancel event
message "&cYou can't use that weapon" to player

chance of 0%:
message "1" to player

chance of 0%:
message "2" to player

chance of 0%:
message "3" to player

chance of 100%:
apply potion of slowness of tier 1 to player for 1 seconds
give 1 of skull of "Box_o" parsed as offline player named "Box_o" to player
wait 30 second
remove skull from player's inventory
 
Hey, try this code:

Code:
right click on player:
  player's tool is not air:
    name of entity = "deneme"
    set {_tool} to player's tool
    {_tool} is skull:
      cancel event
      message "&cYou can't use that weapon" to player
      chance of 1%:
        message "1" to player
      chance of 2%:
        message "2" to player
      chance of 3%:
        message "3" to player
      chance of 100%:
        apply potion of slowness of tier 1 to player for 1 seconds
        give 1 of skull of "Box_o" parsed as offline player named "Box_o" to player
        wait 30 second
        loop all items in player's inventory:
          "%loop-value%" is "Box_o":
            remove loop-item from inventory of player
 
Hey, try this code:

Code:
right click on player:
  player's tool is not air:
    name of entity = "deneme"
    set {_tool} to player's tool
    {_tool} is skull:
      cancel event
      message "&cYou can't use that weapon" to player
      chance of 1%:
        message "1" to player
      chance of 2%:
        message "2" to player
      chance of 3%:
        message "3" to player
      chance of 100%:
        apply potion of slowness of tier 1 to player for 1 seconds
        give 1 of skull of "Box_o" parsed as offline player named "Box_o" to player
        wait 30 second
        loop all items in player's inventory:
          "%loop-value%" is "Box_o":
            remove loop-item from inventory of player
thank you for this but it doesnt work
 
Remove it in the code
right click on player:
name of entity = "deneme"
if player has skull:
remove skull from player's inventory
cancel event
set {_chance} to a random integer between 1 and 100
if {_chance} is between 1 and 50:
give player skull of "MHF_ArrowDown" parsed as offline player named "&f1"
if {_chance} is between 51 and 100:
give player skull of "MHF_ArrowDown" parsed as offline player named "&f2"

right click on player:
name of entity = "1 musteri"
remove skull named "&f1" from player's inventory

i need to remove like this
 
Code:
right click on player:
  name of entity = "deneme"
  "%name of player's tool%" is "&f1":
    remove event-item from player's inventory
    cancel event
    set {_chance} to a random integer between 1 and 100
    if {_chance} is between 1 and 50:
      give player skull of "MHF_ArrowDown" parsed as offline player named "&f1"
    if {_chance} is between 51 and 100:
      give player skull of "MHF_ArrowDown" parsed as offline player named "&f2"

right click on player:
  name of entity = "1 musteri"
  loop all items in player's inventory:
    "%loop-value%" is "&f1":
      remove loop-item from inventory of player

This code works for me