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.

Function is not a text

Discussion in 'Skript' started by SoPastel, Jul 19, 2021.

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

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    Skript Version: 2.6
    Server Version: 1.8

    When I try to load this skript it gives me the error: 'gui(p: player) is not a text' and I am not sure why.

    Code:
    Code (Text):
    1. function gui(p: player):
    2.     wait 1 tick
    3.     open chest with 3 rows named "&d&lTest Gui" to {_p}
     
    #1 SoPastel, Jul 19, 2021
    Last edited: Jul 19, 2021
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    Code (Text):
    1. function gui(p: player):
    2.   wait 1 tick
    3.   open chest with 3 rows named "&d&lTest Gui" to {_p}
     
  3. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    Woops, it was already supposed to be like this, I uploaded it wrong. It still does not work like this either.
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    Then this can't be your whole script. Maybe somewhere above you forget to add a " or smth
     
  5. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    This is the entire code I have, it works fine without defining the function, but when I define the function it gives me that error.

    Code (Text):
    1. function gui(p: player):
    2.     wait 1 tick
    3.     open chest with 3 rows named "&d&lTest Gui" to {_p}
    4.  
    5. command /achievments [<text>]:
    6.     aliases: /ach, /ac, /aa
    7.     permission: achievments.main
    8.     trigger:
    9.         if arg 1 is not set:
    10.             open chest with 6 rows named "&b&lMain Menu" to player
    11.             set slot 22 of player's current inventory to a diamond named "&b&lTiered Achievments"
    12.             set slot 13 of player's current inventory to a emerald named "&a&lMain Achievments"
    13.  
    14. on inventory click:
    15.     if inventory name of player's current inventory is "&b&lMain Menu":
    16.         cancel event
    17.         if clicked slot is 22:
    18.             send "opened" to player
    19.             gui(player)
     
Thread Status:
Not open for further replies.

Share This Page

Loading...