Functions and communicating with the console

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

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

KiwiFruit555

Member
Aug 29, 2021
3
0
1
17
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:
command /itemkiller:
    trigger:
        set ({itemkiller} to toggle({itemkiller}, "ItemKiller", player)
function toggle(a: number, b: text, c: player) :: number :
    if {_a} is 1:
        message kiuimsg("Turned %{_b}% off")
        return 0
        exit trigger
    if {_a} is 0:
        message kiuimsg("Turned %{_b}% on")
        return 1
        exit trigger
    else:
        message kiuimsg("Sorry there must have been an error!")
function kiuimsg(a: text) :: text:
    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.
 
Status
Not open for further replies.