can anyone fix this

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

AdenR84

Active Member
Sep 4, 2023
85
0
6
23
pls help
Code:
on right click:
  if player's tool is a stone hoe:
    set {m1garrand.%uuid of player%} to held item
    if {bulletsM1.%uuid of player%} is not set:
      set {bulletsM1.%uuid of player%} to 5
    if {bulletsM1.%uuid of player%} > 0:
      shoot a snowball from player at speed 2.5
      play sound "GLASS_BREAK" with volume 100 with pitch 1 at player
      remove 1 from {bulletsM1.%uuid of player%}
    if {bulletsM1.%uuid of player%} is 0:
      loop 5 times:
        set {reloading.%uuid of player%} to true
        if {bulletsM1.%uuid of player%} < 5:
          wait 1.5 second
          add 1 to {bulletsM1.%uuid of player%}
          if {bulletsM1.%uuid of player%} > 5:
            set {bulletsM1.%uuid of player%} to 5
            set {reloading.%uuid of player%} to false
            broadcast "false"
 
Where is the error showing in-game?

I'm not sure but I think it can be the 3rd line "held item" probably should "player's held item" or "player's tool"

I would use player's tool beacuse you made it in 2nd like to check if it's a hoe and that counts as a tool.
 
pls help
Code:
on right click:
  if player's tool is a stone hoe:
    set {m1garrand.%uuid of player%} to held item
    if {bulletsM1.%uuid of player%} is not set:
      set {bulletsM1.%uuid of player%} to 5
    if {bulletsM1.%uuid of player%} > 0:
      shoot a snowball from player at speed 2.5
      play sound "GLASS_BREAK" with volume 100 with pitch 1 at player
      remove 1 from {bulletsM1.%uuid of player%}
    if {bulletsM1.%uuid of player%} is 0:
      loop 5 times:
        set {reloading.%uuid of player%} to true
        if {bulletsM1.%uuid of player%} < 5:
          wait 1.5 second
          add 1 to {bulletsM1.%uuid of player%}
          if {bulletsM1.%uuid of player%} > 5:
            set {bulletsM1.%uuid of player%} to 5
            set {reloading.%uuid of player%} to false
            broadcast "false"
Just ran your code through the parser. There isn't any errors with the code itself but that could mean it could have some logic errors. It would be best to provide a screenshot or explain what part of your code isn't working.
 
ok so the last 7 lines "the reload funcion" isnt working and its letting me shoot while im reloading