#How to split variables, such as my %die_test% variable can identify the player and a value, how to s

1 messages · Page 1 of 1 (latest)

frank jasper
#

whats the format exactly?

#

you can parse it

#
set {} to ... parsed as "%string%%player%"
storm tiger
#

%ldp_die2% This variable can resolve the player and a number of deaths

#

@frank jasper I want to split it into two variables

#

Identify the name and value of this variable individually

frank jasper
storm tiger
#

papi variable

frank jasper
#

placeholder

#

what does the placeholder return exactly, give an example

storm tiger
#

Because I don't know how to make the sk variable so that it can record the player's name and the number of deaths when the player dies

#
  if attacker is not a player:
    if "%region at victim%" contains "tcsldp":
      add 1 to {deaths::%victim%}
      loop all players:
        "%region at loop-player%" contains "tcsldp"
        Send title "&cThis time it's &a&l%victim%&c died" with subtitle "&cYou're lucky lol!" to loop-player for 60 tick with fadein 20 tick and fade out 20 tick```
#

this is my variable

#

He can only get the number of deaths of the player

frank jasper
#

you already know the player tho

storm tiger
#

I want to add the player name of the person who let him get the death

frank jasper
#

do you want to make a command to show the deaths?

frank jasper
#

just use attacker then

#

to get the killer

#

if that's what you mean

storm tiger
#

Can't add a player name information directly to the variable?

#

Because not all variables have such incidents as attackers

frank jasper
#

what use would this have for you?

#

you want to add the killer to a variable for each death?

storm tiger
#

I want to make a leaderboard and need to separate the name and value

frank jasper
#

the way you currently have it works just fine

#

for a leaderboard

storm tiger
#

But now I only get the value without the player name

frank jasper
#

you want a leaderboard for deaths?

storm tiger
#

I can't tell in the leaderboard which player has that many numbers

storm tiger
frank jasper
#
loop sorted indieces of {deaths::*} in descending order:
    # loop-value = name of player
    # {deaths::%loop-value%} = the amount of deaths
storm tiger
#

I just want to get the name, will it be hard

frank jasper
#

if you want for example a top 10, you just do

loop sorted indieces of {deaths::*} in descending order:
    add 1 to {_}
    send "%loop-value% has died %{deaths::%loop-value%}% times."
    exit if {_} = 10
#

that'd be a top 10 for deaths

storm tiger
#
  If identifier is "ldp_die":
    Set result to "%{deaths::%player%}% %player%"```If you write like this, you can get the player name, but I can't split it
frank jasper
#

you dont need placeholders

storm tiger
#

Mainly what I need now is not this

#

I have a plug-in that can identify the top ten of the leaderboard

#

But I mainly want to split this player name, or the player name that can read this variable

frank jasper
#

you're overcomplicating things

storm tiger
#

seems to be true

#

loop sorted indieces of {deaths::*} in descending order:
# loop-value = name of player
# {deaths::%loop-value%} = the amount of deaths

#

I don't know how to apply this to

#

in my game

#

oops

frank jasper
#

i gave you a full example

storm tiger
#

But can this example be used in the scoreboard plugin?

#

I mainly want to do it in the scoreboard plugin

#

bro