Solved the chat message can't be set to {_lol} parsed as a offline player because the latter is not a text

  • 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.
Try "%{_lol}%" parsed as player, and remember to use the help request format:emoji_slight_smile:
 
[Skript] the chat message can't be set to "%{_lol}%" parsed as a offline player because the latter is not a text
 
because youre parsing it as an offline player so its not a text anymore...
 
well set the message to it while its still a text then change it to an offline player and do whatever you need to with it
 
@Donut @Wynnevir
I don't understand. Here is the script:

code_language.skript:
on chat:
    if {startFunction.%player%} is true:
        cancel event
        set message to {_lol}
        testing(player, {_lol})
        stop

function testing(p: player , arg1: offline player) :: text:
    broadcast "Working!"
    if skellettcord "%{_arg1}%" is online bungeecord:
        set {_uuid} to bungee uuid of "%{_arg1}%"
        message coloured "%{_p}% sent you a friend request :D" to bungeecord player "%{_uuid}%"


Im making a script that will send a friend request to a player if you type their name in Chat.
But It won't start the function.

Please help.
 
@Donut @Wynnevir
I don't understand. Here is the script:

code_language.skript:
on chat:
    if {startFunction.%player%} is true:
        cancel event
        set message to {_lol}
        testing(player, {_lol})
        stop

function testing(p: player , arg1: offline player) :: text:
    broadcast "Working!"
    if skellettcord "%{_arg1}%" is online bungeecord:
        set {_uuid} to bungee uuid of "%{_arg1}%"
        message coloured "%{_p}% sent you a friend request :D" to bungeecord player "%{_uuid}%"


Im making a script that will send a friend request to a player if you type their name in Chat.
But It won't start the function.

Please help.
The first issue was how you set your variable for the message, the variable has to come first. The next was that your function was requesting arg1 as an offline player, and {_lol} is a text. So I set arg1 in your function to request a text instead, and then once it accepted it, reset the variable to be parsed as an offline player. Also your function didn't need to return anything, so took that out. Tested this and it's working for me(as far as triggering the function. I don;t have bungee to test the rest)
code_language.skript:
on chat:
    cancel event
    set {_lol} to the message
    testing(player, {_lol})
    stop
 
function testing(p: player, arg1: text):
    broadcast "Working!"
    set {_arg1} to {_arg1} parsed as offline player
    if skellettcord "%{_arg1}%" is online bungeecord:
        set {_uuid} to bungee uuid of "%{_arg1}%"
        message coloured "%{_p}% sent you a friend request :D" to bungeecord player "%{_uuid}%"
 
Status
Not open for further replies.