cant compare with an integer

  • 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.
Feb 10, 2021
18
0
1
22
  1. Script Version 2.5.3:
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:

  5. command /skills:
    trigger:
    set {_prefix} to placeholder "player_level" # placeholder "%%player_level%%" is also valid
    set {_gui} to a new chest inventory with 6 row with name "&c&lSkills"
    set slot 40 of {_gui} to red stained glass pane named "&c&lStrength" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 41 of {_gui} to blue stained glass pane named "&3&lIntelligence" with lore "&6&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 39 of {_gui} to yellow stained glass pane named "&e&lAgility" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 38 of {_gui} to white stained glass pane named "&7&lResistance" with lore "&6&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 42 of {_gui} to purple stained glass pane named "&5&lWizardry" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 13 of {_gui} to skull of ("%Player%" parsed as offline player) named "&7&l%player%" with lore "&aL&6e&av&6e&al&6: &d&l&n%{_prefix}%"
    open {_gui} to player

    on inventory click:
    name of event-inventory is "&c&lSkills"
    cancel event

    on inventory click:
    name of event-inventory is "&c&lSkills"
    if index of event-slot = 39
    if {skillpoints.var} greater then 0
    set {skillpoints.var} to {skillpoints.var} - 1
    set {agility.var} to {agility.var} + 1

  6. Errors on Reload:
event-slot is not a world (Skills.sk, line 20: if index of event-slot = 39'}

cant understand this condition/effect if {skillpoints.var} greater then 0 (Skills.sk, line 21: if {skillpoints.var} greater then o'





  1. Console Errors: (if applicable)
none

  1. Other Useful Info:
none but it would help if someone could give me a solution and the working code

  1. Addons using (including versions):
  2. ersatz
  3. Troubleshooting:

  4. Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?
  5. tried changing versions and looking on google but nothing helped
 
  1. Script Version 2.5.3:
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:

  5. command /skills:
    trigger:
    set {_prefix} to placeholder "player_level" # placeholder "%%player_level%%" is also valid
    set {_gui} to a new chest inventory with 6 row with name "&c&lSkills"
    set slot 40 of {_gui} to red stained glass pane named "&c&lStrength" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 41 of {_gui} to blue stained glass pane named "&3&lIntelligence" with lore "&6&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 39 of {_gui} to yellow stained glass pane named "&e&lAgility" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 38 of {_gui} to white stained glass pane named "&7&lResistance" with lore "&6&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 42 of {_gui} to purple stained glass pane named "&5&lWizardry" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
    set slot 13 of {_gui} to skull of ("%Player%" parsed as offline player) named "&7&l%player%" with lore "&aL&6e&av&6e&al&6: &d&l&n%{_prefix}%"
    open {_gui} to player

    on inventory click:
    name of event-inventory is "&c&lSkills"
    cancel event

    on inventory click:
    name of event-inventory is "&c&lSkills"
    if index of event-slot = 39
    if {skillpoints.var} greater then 0
    set {skillpoints.var} to {skillpoints.var} - 1
    set {agility.var} to {agility.var} + 1

  6. Errors on Reload:
event-slot is not a world (Skills.sk, line 20: if index of event-slot = 39'}



cant understand this condition/effect if {skillpoints.var} greater then 0 (Skills.sk, line 21: if {skillpoints.var} greater then o'





  1. Console Errors: (if applicable)
none

  1. Other Useful Info:
none but it would help if someone could give me a solution and the working code

  1. Addons using (including versions):
  2. ersatz
  3. Troubleshooting:

  4. Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?
  5. tried changing versions and looking on google but nothing helped
In 1.16.3+, i make vanilla inventories like this:

code_language.skript:
command /example:
   trigger:
        set metadata tag "YourMetaData" of player to chest inventory with 6 rows named "&aName &bOf &cInventory"
        set slot 10 of metadata tag "YourMetaData" of player to lapis lazuli named "&1Name of item" with lore "Lore1", "Lore2"
        open (metadata tag "YourMetaData" of player) to player

on inventory click:
    event-inventory = (metadata tag "YourMetaData" of player):
        cancel event
        index of event-slot = 10:
            #Effect...
            send "&cRed" #Example
Also, the second error is because it's misspelled.
code_language.skript:
if {skillpoints.var} is greater than 0:
#or
if {skillpoints.var} > 0:
[doublepost=1614123273,1614123164][/doublepost]For vanilla inventories, i recommend you see Vanilla GUIs
 
it would really help if u could just give me a working version of the code
[doublepost=1614132146,1614131430][/doublepost]cause it only fixed the index of slot thingy one
 
it would really help if u could just give me a working version of the code
[doublepost=1614132146,1614131430][/doublepost]cause it only fixed the index of slot thingy one
What? I just gave you the way to solve your problem. All you have to do is replace the Example code that i sent you and change it for yours. It's not complicated.

If an error still persists, send a screenshot with the error and the code that fails.

Anyways, this should work.
code_language.skript:
options:
    meta: SkillsInvMeta001

command /skills:
    trigger:
       set metadata tag "{@meta}" of player to chest inventory with 6 rows named "&c&lSkills"
       set {_prefix} to placeholder "player_level"
       set slot 13 of metadata tag "{@meta}" of player to player's head named "&7&l%player%" with lore "&aL&6e&av&6e&al&6: &d&l&n%{_prefix}%"
     
       set slot 40 of metadata tag "{@meta}" of player to red stained glass pane named "&c&lStrength" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
       set slot 41 of metadata tag "{@meta}" of player to blue stained glass pane named "&3&lIntelligence" with lore "&6&l%{skillpoints.var}% &dSkill point(s) available."
       set slot 39 of metadata tag "{@meta}" of player to yellow stained glass pane named "&e&lAgility" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
       set slot 38 of metadata tag "{@meta}" of player to white stained glass pane named "&7&lResistance" with lore "&6&l%{skillpoints.var}% &dSkill point(s) available."
       set slot 42 of metadata tag "{@meta}" of player to purple stained glass pane named "&5&lWizardry" with lore "&a&l%{skillpoints.var}% &dSkill point(s) available."
       open (metadata tag "{@meta}" of player) to player


on inventory click:
    event-inventory = (metadata tag "{@meta}" of player):
        cancel event
        index of event-slot = 39:
            if {skillpoints.var} > 0:
                subtract 1 from {skillpoints.var}
                add 1 to {agility.var}
Also, i dont know if you want to use a variable per player. If that's the case, use:
code_language.skript:
{skillpoints.%player%} #<-- add %player%
 
yeah sorry im dumb i just dont understand meta data yet. so sorry on not understanding the skript u gave me cause i started skript like a week ago or a bit more
 
yeah sorry im dumb i just dont understand meta data yet. so sorry on not understanding the skript u gave me cause i started skript like a week ago or a bit more
It is not difficult to understand, it is something like to identify an inventory. Something similar to what variables do. I recommend you see this tutorial of Vanilla GUIs
[doublepost=1614205299,1614204879][/doublepost]Excuse me, i've made a mistake. "Something like variables", not "Something similar to what variables do".
 
Status
Not open for further replies.