Check variable of an offline player?

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

dudle

Active Member
Jan 31, 2017
135
0
16
44
How can I do for example:

/checkkills [<offline player>]:
message "%{kills.%uuid of arg 1%}%"
if the player is not online?

It just sends me "<none>"
 
How can I do for example:

/checkkills [<offline player>]:
message "%{kills.%uuid of arg 1%}%"
if the player is not online?

It just sends me "<none>"
Use:

Code:
Set {_uuid} to (arg-1 parsed as offlineplayer)'s uuid
message "%{kills.%{_uuid}%}%"
 
@dudle

You can use both:
code_language.skript:
command /kills [<offlineplayer>]:
    trigger:
        set {_uuid} to uuid of arg-1
        message "&3Kills&8: &b%{kills.%{_uuid}%}%"
        
command /kills [<offlineplayer>]:
    trigger:
        message "&3Kills&8: &b%{kills.%uuid of arg-1%}%"
Counter:
code_language.skript:
on death:
    attacker is a player
    victim is a player
    add 1 to {kills.%uuid of attacker%}
 
@dudle

You can use both:
code_language.skript:
command /kills [<offlineplayer>]:
    trigger:
        set {_uuid} to uuid of arg-1
        message "&3Kills&8: &b%{kills.%{_uuid}%}%"
       
command /kills [<offlineplayer>]:
    trigger:
        message "&3Kills&8: &b%{kills.%uuid of arg-1%}%"
Counter:
code_language.skript:
on death:
    attacker is a player
    victim is a player
    add 1 to {kills.%uuid of attacker%}
the set {_uuid} to uuid of arg-1 says that it's not a type
 
code_language.skript:
command /checkkills [<offline player>]:
    trigger:
        if {kills.%uuid of arg-1%} is not set:
            set {kills.%uuid of arg-1%} to 0
        message "%arg-1% Kills: %{kills.%uuid of arg-1}%"

on death:
    attacker is a player
    victim is a player
    add 1 to {kills.%uuid of attacker%}
 
Last edited by a moderator:
code_language.skript:
command /checkkills [<offline player>]:
    trigger:
        if {kills.%uuid of arg-1%} is not set:
            set {kills.%uuid of arg-1%} to 0
        message "%arg-1% Kills: %{kills.%uuid of arg-1}%"

on death:
    attacker is a player
    victim is a player
    add 1 to {kills.%uuid of attacker%}
Yeah it works fine, but it's not supposed to send me 0 always you know. It should send the amount of kills a player has. I have the variables working, everything set up and working fine, except for the offline checker thing.

Anyone that can help me with this? Maybe a database is needed for this?
 
If the variable is not seted, the variable changes to 0, and if anyone kills a player the variable changes to add 1.
My english is not very fluent, if i have an error respose me.
 
If the variable is not seted, the variable changes to 0, and if anyone kills a player the variable changes to add 1.
My english is not very fluent, if i have an error respose me.
Yeah but it is actually set, because when the player's online and I check their kills it displays their kills (I think they had like 4 or smth whatever), so it should send me the number 4 not any other...
[doublepost=1491244803,1491166701][/doublepost]Someone please?
 
Status
Not open for further replies.