Convert

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

    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!

ezworth

Member
Jul 15, 2024
1
0
1
Code:
command /convert:
    trigger:
        if player has 5 of stick with CustomModelData 10072:
            remove 5 of stick with CustomModelData 10072 from player
            give player 1 of stick with custom model data 10073
            send "&aEşyalar başarıyla dönüştürüldü!" to player
        else:
            send "&cYeterli 10072 model stick'iniz yok!" to player

I wanted to write a minecraft skript that would give 1 custom model data 10073 stick instead of 5 custom model data 10072 stick items with the /convert command, but I couldn't succeed, how can I do it?
 
Code:
command /convert:
    trigger:
        if player has 5 of stick with CustomModelData 10072:
            remove 5 of stick with CustomModelData 10072 from player
            give player 1 of stick with custom model data 10073
            send "&aEşyalar başarıyla dönüştürüldü!" to player
        else:
            send "&cYeterli 10072 model stick'iniz yok!" to player

I wanted to write a minecraft skript that would give 1 custom model data 10073 stick instead of 5 custom model data 10072 stick items with the /convert command, but I couldn't succeed, how can I do it?
Try using this resource (Keep in mind you can use variables to store data like items too!): Custom Model Data Expression

Solution (PS: Don't spoon feed code :emoji_stuck_out_tongue:):
Code:
on load:
   set {i} to stick with custom model data 10072
   set {i2} to stick with custom model data 10073

command convert:
   trigger:
      player has 5 of {i}
      remove 5 of {i} from player
      give player 1 of {i2}
      send "&aEşyalar başarıyla dönüştürüldü!" to player
      if player does not have 5 of {I}:
         send "&cYeterli 10072 model stick'iniz yok!" to player