1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Function not working

Discussion in 'Skript' started by WiebeHero, Sep 16, 2017.

Thread Status:
Not open for further replies.
  1. WiebeHero

    WiebeHero Active Member

    Joined:
    Aug 23, 2017
    Messages:
    135
    Likes Received:
    5
    So i have been using tuske gui manager for a while now but this wont work for some odd reason?

    format gui slot 50 of player with paper named "&7Next Page" to run function openMenu()

    function openMenu(p: Player, type: String):
    if {_type} is "Enchantments 1/3":
    open virtual chest inventory with size 1 named "Enchantments 2/3" to {_p}
    Wierdly its not opening a virtual chest so if anyone could help me with this it would be great! :emoji_grinning:
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    are you sure {_type} is "Enchantments 1/3"? With a problem like this you should always broadcast the variable and/or put a broadcast after the condition to see if its true.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    well the thing is what does that mean the type
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Not sure what youre asking? {_type} is the string youre inputting into the function?
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    So you mean what im putting it into the function? hmmm.... then i think its openmenu itself i gues?
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    i was asking if you are sure that {_type} is "Enchantments 1/3" or else it will never run the code to open the inventory

    is this how youre calling the function?
    Code (Skript):
    1. format gui slot 50 of player with paper named "&7Next Page" to run function openMenu()
    if so then you need to call the function with arguments like so
    Code (Skript):
    1. format gui slot 50 of player with paper named "&7Next Page" to run function openMenu(player, "Enchantments 1/3")
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Holy shit my man you did it THANK YOU SO MUCH!!!! oh and 1 more thing.
    Know where i can find a addon wich lets you remove tags from items changing attack damage and renaming items? Still THANK YOU!!!!!
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    to rename an item you dont need an addon
    Code (Skript):
    1. set name of <insert item here> to "hey"
    you can probably remove the tags using nbt which would need skstuff
     
Thread Status:
Not open for further replies.

Share This Page

Loading...