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.

Check variable of an offline player?

Discussion in 'Skript' started by dudle, Apr 1, 2017.

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

    dudle Active Member

    Joined:
    Jan 31, 2017
    Messages:
    135
    Likes Received:
    0
    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>"
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Use:

    Code (Text):
    1.  
    2. Set {_uuid} to (arg-1 parsed as offlineplayer)'s uuid
    3. message "%{kills.%{_uuid}%}%"
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    It says that it's not a type
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Skript version + full code?
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    2.2
    Code (Skript):
    1.  
    2. command /checkkills [<offline player>]:
    3.     trigger:
    4.         Set {_uuid} to (arg-1 parsed as offlineplayer)'s uuid
    5.         message "%{kills.%{_uuid}%}%"
    6.  
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Maybe replace
    Code (Text):
    1.  [<offline player>] with [<text>]
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Says <none>...
    --- Double Post Merged, Apr 1, 2017, Original Post Date: Apr 1, 2017 ---
    Anyone please?
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    @dudle

    You can use both:
    Code (Skript):
    1. command /kills [<offlineplayer>]:
    2.     trigger:
    3.         set {_uuid} to uuid of arg-1
    4.         message "&3Kills&8: &b%{kills.%{_uuid}%}%"
    5.        
    6. command /kills [<offlineplayer>]:
    7.     trigger:
    8.         message "&3Kills&8: &b%{kills.%uuid of arg-1%}%"
    Counter:
    Code (Skript):
    1. on death:
    2.     attacker is a player
    3.     victim is a player
    4.     add 1 to {kills.%uuid of attacker%}
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    the set {_uuid} to uuid of arg-1 says that it's not a type
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Code (Skript):
    1. set {_uuid} to uuid of "%arg-1%" parsed as offline player
    You can just use the second example.
     
  11. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Still sends <none>
     
  12. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Can't you just use:
    Code (Skript):
    1. command /kills [<offlineplayer>]:
    2.     trigger:
    3.         message "&3Kills&8: &b%{kills.%uuid of arg-1%}%"
     
  13. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    It also says <none> ;-;
     
  14. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Are you sure that the player has the variable setted?
     
  15. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Yes, because when the player's online it shows with no problems
     
  16. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    Code (Skript):
    1. command /checkkills [<offline player>]:
    2.     trigger:
    3.         if {kills.%uuid of arg-1%} is not set:
    4.             set {kills.%uuid of arg-1%} to 0
    5.         message "%arg-1% Kills: %{kills.%uuid of arg-1}%"
    6.  
    7. on death:
    8.     attacker is a player
    9.     victim is a player
    10.     add 1 to {kills.%uuid of attacker%}
     
    #16 ShaneBee, Apr 2, 2017
    Last edited by a moderator: Apr 2, 2017
  17. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    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?
     
  18. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    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.
     
  19. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    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...
    --- Double Post Merged, Apr 3, 2017, Original Post Date: Apr 2, 2017 ---
    Someone please?
     
  20. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,170
    Likes Received:
    215
    The code works well , it's not a script problem.
    Try to use %player% instead of %uuid of player% , it should work.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...