Not doing what it is supposed to do

Discussion in 'Skript' started by Conutik_MC, Jan 8, 2020.

  1. Im having a promblem with my skript there are no errors but it isnt giving a player the coin


    Code (Text):
    every second:
      set {_c} to "StackedGold" parsed as an offline player
      loop all players:
        loop all items in loop-player's inventory:
          if loop-item is skull of {_c} named "&6Coin Pet" with lore " " and " " and "&7Give Player 1 gold coin every 5 seconds":
            give loop-player 1 of gold nugget named "&6Golden Coin"
            broadcast "hey"
    on damage:
      set {_b} to "Summoning_eye" parsed as an Offline player
      loop all items in attacker's inventory:
        if loop-item is skull of {_b} named "&bMedusa Pet" with lore " " and " " and "&7Damage a player to make him turn into stone":
          set {_m} to location of victim
          set block {_m} to stone
          set block above {_m} to stone
          set {Medusa.%victim%} to true
          wait 10 seconds
          set block {_m} to air
          set block above {_m} to air
          set {Medusa.%victim%} to false

    on any movement:
      if {Medusa.%player%} is not set:
        stop
      else:
        if {Medusa.%player%} is true:
          cancel event
          send "&eYou may not move right now"
     
  2. do not use on any move like that, it is not what it is meant for, and it is inefficient to double check variable, by checking if it is not set and then checking true, just check if it is set, that's all you need. a while loop with one tick delay would be better and use {variable::%uuid of player%} format. never set your variables to false instead of deleting them, that is a memory leak.

    (other issues have been answered in the private message you sent me)

    also for your medusa effect, you could set walking speed of player to 0, set hunger of player to 3 and apply negative jump boost effect (like 250) so the player can't jump or move, that way it would be smooth turning into stone with no way to move with no teleport backs (but still have a loop which compares locations and teleports player in case of lag delay with client getting to know about the effects)