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.

Functions and communicating with the console

Discussion in 'Skript' started by KiwiFruit555, Oct 6, 2021.

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

    KiwiFruit555 Member

    Joined:
    Aug 29, 2021
    Messages:
    3
    Likes Received:
    0
    Script Version: 2.6-beta3
    Script Author: KiwiFruit555 (Me)
    Minecraft Version: 1.17.1 (Paper)

    The issue is that I need to send a message to the console if the one sending it was the console. There are no errors in the code, it just doesn't work. It stopped working when I tried to implement functions instead of repeating the same code over and over

    Partial Code (I am working through SSH, I can't copy, and I don't feel like typing everything):
    Code (Text):
    1. command /itemkiller:
    2.     trigger:
    3.         set ({itemkiller} to toggle({itemkiller}, "ItemKiller", player)
    4. function toggle(a: number, b: text, c: player) :: number :
    5.     if {_a} is 1:
    6.         message kiuimsg("Turned %{_b}% off")
    7.         return 0
    8.         exit trigger
    9.     if {_a} is 0:
    10.         message kiuimsg("Turned %{_b}% on")
    11.         return 1
    12.         exit trigger
    13.     else:
    14.         message kiuimsg("Sorry there must have been an error!")
    15. function kiuimsg(a: text) :: text:
    16.     return "<gray>[<pink>Kiui Moderation<gray>] <reset>%{_a}%"



    Other Useful Info:

    Addons using (including versions):
    none

    Have you tried searching the docs?
    Have you tried searching the Forums?
    What other methods have you tried to fix it?

    I have tried searching docs and forums for an answer and I cannot find one.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...