Solved function

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

Status
Not open for further replies.

loadka95

Active Member
Feb 24, 2017
78
6
8
im using the fuctions for the first time, and i try to make this:
code_language.skript:
function "book":
    loop player's inventory:
        if name of loop-item is "asd":
            remove loop-item from player's inventory
            stop
            wait 1 tick
            return
command /bkk:
    trigger:
        access "book"
but im getting this error message:
[19:10:55 ERROR]: Invalid function definition. Please check for typos and that the function's name only contains letters and underscores. Refer to the documentation for more information. (kul.sk, line 12: function "book":')
[19:10:55 ERROR]: Invalid function definition. Please check for typos and that the function's name only contains letters and underscores. Refer to the documentation for more information. (kul.sk, line 12: function "book":')
 
Don't use skQuery functions, Skript has his own function-system.
https://forums.skunity.com/threads/functions.41/

This would look like this:
code_language.skript:
function book(p: player):
    loop {_p}'s inventory:
        name of loop-item is "asd":
            remove loop-item from {_p}'s inventory
            
command /bkk:
    trigger:
        book(player)
 
  • Like
Reactions: loadka95
Status
Not open for further replies.