Solved return something in function when clicked on inventory with skript-gui

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

TigerCrafter

New Member
Aug 8, 2024
6
0
1
i have a function that creates a gui and when a player clicks on a item it returns something. when i want to reload my skript it says "The return statement cannot be used here"
 
i have a function that creates a gui and when a player clicks on a item it returns something. when i want to reload my skript it says "The return statement cannot be used here"
You have to set up the function to be able to return values (Could be boolean, text, an item, etc) and attach that value to the end when you create your function.

Like so:
Code:
function ExampleFunction(t: text) :: boolean:
   if {_t} is "Option1":
      return true
   else:
      return false
 
You have to set up the function to be able to return values (Could be boolean, text, an item, etc) and attach that value to the end when you create your function.

Like so:
Code:
function ExampleFunction(t: text) :: boolean:
   if {_t} is "Option1":
      return true
   else:
      return false
Now I don't need it anymore and I'm not sure but i think I already did this and it didn't work. But Thank you anyways!