Discord Thread <none>

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

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,755
1
0
The skUnity Discord
discord.gg
the skript works well but when i put a integer in the command, the fuction returns <none>

code_language.skript:
skript
function getCardinal(i: integer):
  if length of {_i} is between -1 and 4:
    stop
  if length of {_i} is between 3 and 7:
    set {c} to "k"
  if length of {_i} is between 6 and 10:
    set {c} to "m"
  if length of {_i} is between 9 and 13:
    set {c} to "b"
  if length of {_i} is between 12 and 16:
    set {c} to "t"

command /num <integer>:
  trigger:
    getCardinal(arg-1)
    wait 1 second
    message "&c%{c}%"

Posted by: lzylv from the skUnity Discord. View the thread on skUnity Discord here
 
code_language.skript:
function getCardinal(i: integer) :: integer:
  if length of {_i} is between -1 and 4:
    stop
  if length of {_i} is between 3 and 7:
    set {c} to "k"
  if length of {_i} is between 6 and 10:
    set {c} to "m"
  if length of {_i} is between 9 and 13:
    set {c} to "b"
  if length of {_i} is between 12 and 16:
    set {c} to "t"
  return {c}


command /num <integer>:
  trigger:
    getCardinal(arg-1)

added a return to the function, outputs <none>
function getCardinal(i: integer) :: text:
  if length of {_i} is between -1 and 4:
    stop
  if length of {_i} is between 3 and 7:
    set {c} to "k"
  if length of {_i} is between 6 and 10:
    set {c} to "m"
  if length of {_i} is between 9 and 13:
    set {c} to "b"
  if length of {_i} is between 12 and 16:
    set {c} to "t"
  return {c}


command /num <integer>:
  trigger:
    getCardinal(arg-1)
    wait 1 second
    message "%{c}%"
added return, gonna remove message but then it dosent send anything. still outpouts <none>

Posted by: lzylv from the skUnity Discord.
 
No,
send “%functionWithReturn()%”

Wherever you call the function will be replaced with the return
Like this
code_language.skript:
function example(n: number, v: number) :: number:
  return {_n} * {_v}

on death:
  if example(10, 5) = 50:
    send “%example(4, 3)%” to victim

Posted by: x8ight from the skUnity Discord.
 
Status
Not open for further replies.