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 call function help

Discussion in 'Skript' started by Choong Yun Chean, Sep 19, 2018.

Thread Status:
Not open for further replies.
  1. Choong Yun Chean

    Joined:
    Jul 9, 2017
    Messages:
    34
    Likes Received:
    0
    how to call function with " " this ??

    using a text to call a function

    example like "%{_FunctionName}%"(player)

     
  2. Best Answer:
    Post #5 by ShaneBee, Sep 21, 2018
  3. DieHollander_

    DieHollander_ Active Member

    Joined:
    Mar 25, 2018
    Messages:
    188
    Likes Received:
    12
    "%functionname(player)%"

    It must return something to use this.
     
  4. Choong Yun Chean

    Joined:
    Jul 9, 2017
    Messages:
    34
    Likes Received:
    0
    im not asking this return value~

    im asking for use "%arg-1%"(player) to run suicide(player)
    and arg-1 is "suicide"
     
  5. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    102
    Medals:
    Send your function
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    You're better off calling the argument IN your function

    like so:
    Code (Skript):
    1. function YourFunctionHere(p: player, t: text):
    2.     if {_t} = "suicide":
    3.         #stuff
    4.  
    5. command /command <text>:
    6.     trigger:
    7.         YourFunctionHere(player, arg-1)
     
  7. Choong Yun Chean

    Joined:
    Jul 9, 2017
    Messages:
    34
    Likes Received:
    0
    Now im using /callfunction[<text>]:
    If arg-1 is "abc"
    Abc(command sender)

    So~no more call function's way????
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    yeah, if you want to do it that way you could
     
  9. jjpwn1

    jjpwn1 Member

    Joined:
    Aug 18, 2018
    Messages:
    12
    Likes Received:
    8
    I think he's trying to see if it's possible to create a command whose single purpose is to call a function using it's text parameter. I really don't know if this is possible, do you know if there's a way?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...