#zombie lvl

1 messages · Page 1 of 1 (latest)

burnt solstice
#

add 1 to a variable

#

and then have a function that displays it as a superscript

unborn pendant
#
add 1 to {example::%player%} or example::player's uuid} for individual
visual bronze
#

how would i do the function

unborn pendant
#
function functionname(ID: type:)
burnt solstice
#

there's also a functions tutorial pinned in #skript-help-2

visual bronze
#

no like ik how to do functions but how do i display it as superscirpt

burnt solstice
#

replace all 1 with ¹, etc

visual bronze
#

ohh

#

ok

dull shadow
#
function num(num: number) :: string:
    set {_num} to "%{_num}%"
    replace "1" with "[thinghere]" in {_num}
    # add more here
    return {_num}

idk if im late but you can do this

visual bronze
#

i think i did it already

#

1 sec

#

sadly this doesnt make it 1 after i kill a zombie

    if victim is a zombie:
        add 1 to {beacon-grab::user::lvl::%attacker's uuid%}
        replaceNumber(attacker)
        
function replaceNumber(p: player):
    replace all "1" with "¹" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "2" with "²" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "3" with "³" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "4" with "⁴" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "5" with "⁵" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "6" with "⁶" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "7" with "⁷" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "8" with "⁸" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "9" with "⁹" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "0" with "⁰" in {beacon-grab::user::lvl::%{_p}'s uuid%}```
burnt solstice
#

i mean

#

you need to stringify it

#

and then return a value

#

but also, once you do, you can treat it like a number

#

so keep it as a number, and then use the function only when displaying it in text

#

also, loop (split "⁰/¹/²/³/⁴/⁵/⁶/⁷/⁸/⁹/" by "/"): replace all "%loop-iteration - 1%" with loop-value ...

visual bronze
burnt solstice
#

make it a string

#

put it in quotes

visual bronze
#

what in string

burnt solstice
visual bronze
#

like ik how to put smth in a string but like where and what do i put in a string

burnt solstice
#

the replace effect only works with strings

#

not numbers

visual bronze
#

ohhh

#

so what should i do then

burnt solstice
#

set a local variable to the stringified variable

visual bronze
#

can u explain it a little better i still dont get it

burnt solstice
#

set {_string} to "%{example::number}%"

visual bronze
#

ok so i set a local var to to the superscript var and then im replacing all 1 with lets say {_superscript::1}?

burnt solstice
visual bronze
#

can u show me what i need to do for let5s say number 1

#

abd the rest ill do

burnt solstice
#

it means I got lazy

#

just continue the line

#

(its the same as what you already have)

visual bronze
#
    loop (split "⁰/¹/²/³/⁴/⁵/⁶/⁷/⁸/⁹/" by "/"):
        replace all "%loop-iteration - 1%" with loop-value
        replace all "%loop-iteration - 2%" with loop-value
        replace all "%loop-iteration - 3%" with loop-value
        replace all "%loop-iteration - 4%" with loop-value
        replace all "%loop-iteration - 5%" with loop-value
        replace all "%loop-iteration - 6%" with loop-value
        replace all "%loop-iteration - 7%" with loop-value
        replace all "%loop-iteration - 8%" with loop-value
        replace all "%loop-iteration - 9%" with loop-value
        replace all "%loop-iteration - 0%" with loop-value```
#

like this?

burnt solstice
#

no

#

the loop will run that line multiple times

#

you you only need the first replace line

#

and you need to add the (string) variable to the end

visual bronze
#

what string

#

var

burnt solstice
visual bronze
#

wait i dont get it

#

so i set the {_string} to %{example::number}% but like whats the var example number are they the numbers with super script

visual bronze
burnt solstice
#

no thats your number

visual bronze
#

wait rn the code does that

add 1 to the var of killed zombies
then it runs the function

so i set {_string} to the killed zombie var

#

and like then where do i put the {_stirng}

burnt solstice
#

you need to have a string there, not a number

visual bronze
#

wait so i set a var to 1 and i set the other var to the super scirpt

burnt solstice
#

no

#

your variable is 1, you want to set a (string) variable to "1"

visual bronze
#

ohh wait so i keep the re[;ace thing and i just set a var to 1

burnt solstice
#

the replace effect only works with strings

visual bronze
#

so i dont use replace

burnt solstice
#

no you do

#

you just need to use it with a string

visual bronze
#

ok so rn it adds 1 when i kill a zombie but it doesnt replace

    set {_0} to 0
    set {_1} to 1
    set {_2} to 2
    set {_3} to 3
    set {_4} to 4
    set {_5} to 5
    set {_6} to 6
    set {_7} to 7
    set {_8} to 8
    set {_9} to 9
    replace all "%{_1}%" with "¹" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_2}%" with "²" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_3}%" with "³" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_4}%" with "⁴" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_5}%" with "⁵" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_6}%" with "⁶" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_7}%" with "⁷" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_8}%" with "⁸" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_9}%" with "⁹" in {beacon-grab::user::lvl::%{_p}'s uuid%}
    replace all "%{_0}%" with "⁰" in {beacon-grab::user::lvl::%{_p}'s uuid%}```
burnt solstice
#

nonononono

#

this is the number: {beacon-grab::user::lvl::%{_p}'s uuid%}

#

you need to set THAT to a string

visual bronze
#

hm but how

burnt solstice
#
replace all "a" with "A" in {_s}```
visual bronze
#

cant i just do them seperatly bc i dont understamd loops

visual bronze
#

i dont get it still:(

burnt solstice
#
set {_string} to "%{_number}%"
replace all "1" with "2" in {_string}
broadcast {_string}```
visual bronze
#

OHHHHHH

#

I THINK I GET IT

#
    set {_string} to "%{beacon-grab::user::lvl::%{_p}'s uuid%}%"
    set {_0} to "0"
    set {_1} to "1"
    set {_2} to "2"
    set {_3} to "3"
    set {_4} to "4"
    set {_5} to "5"
    set {_6} to "6"
    set {_7} to "7"
    set {_8} to "8"
    set {_9} to "9"
    replace all "%{_1}%" with "¹" in {_string}
    replace all "%{_2}%" with "²" in {_string}
    replace all "%{_3}%" with "³" in {_string}
    replace all "%{_4}%" with "⁴" in {_string}
    replace all "%{_5}%" with "⁵" in {_string}
    replace all "%{_6}%" with "⁶" in {_string}
    replace all "%{_7}%" with "⁷" in {_string}
    replace all "%{_8}%" with "⁸" in {_string}
    replace all "%{_9}%" with "⁹" in {_string}
    replace all "%{_0}%" with "⁰" in {_string}```
burnt solstice
#

you still need to return it, but yeah

#

also, there's no need for the local variables

#

just replace all "%{_1}%" -> replace all "1"

visual bronze
#

ohh ok ill tru

burnt solstice
#

but i still really recommend the loop, much cleaner

visual bronze
#
    set {_string} to "%{beacon-grab::user::lvl::%{_p}'s uuid%}%"
    replace all "1" with "¹" in {_string}
    replace all "2" with "²" in {_string}
    replace all "3" with "³" in {_string}
    replace all "4" with "⁴" in {_string}
    replace all "5" with "⁵" in {_string}
    replace all "6" with "⁶" in {_string}
    replace all "7" with "⁷" in {_string}
    replace all "8" with "⁸" in {_string}
    replace all "9" with "⁹" in {_string}
    replace all "0" with "⁰" in {_string}```
#

not working

burnt solstice
#

youre modifying a variable and then doing nothing with it

burnt solstice
visual bronze
burnt solstice
#

you dont

#

you want that one to stay as a number, otherwise you can't add 1 to it

#

you are "cloning" it and then making the clone a superscript

visual bronze
#

this now?

    if victim is a zombie:
        add 1 to {beacon-grab::zombie::%attacker's uuid%}
        replaceNumber(attacker)
        
function replaceNumber(p: player):
    set {_string} to "%{beacon-grab::zombie::%{_p}'s uuid%}%"
    replace all "1" with "¹" in {_string}
    replace all "2" with "²" in {_string}
    replace all "3" with "³" in {_string}
    replace all "4" with "⁴" in {_string}
    replace all "5" with "⁵" in {_string}
    replace all "6" with "⁶" in {_string}
    replace all "7" with "⁷" in {_string}
    replace all "8" with "⁸" in {_string}
    replace all "9" with "⁹" in {_string}
    replace all "0" with "⁰" in {_string}
    set {beacon-grab::user::lvl%{_p}'s uuid%} to {_string}```
#

now it doesnt add 1 anymore and it doesnt do anything

limpid swallow
visual bronze
burnt solstice
#

the superscript is text not a number

#

so you cant add to it

limpid swallow
#

because how are you supposed to add a number to a string

burnt solstice
#

as I said

#

thats why you are cloning the number. So that when you want the superscript, you can get it without ruining the original

limpid swallow
#

just internally keep it as a normal number/integer and only convert it on the fly when you need to display it/make a copy of it

visual bronze
#

man i dont get can anybody clearly tell me what to do npw with idk skript or smth

limpid swallow
#

just keep it as a number

burnt solstice
#

make the function return {_string}, and use that when you want to display it

limpid swallow
#

then only use the function when you need to show it in your custom format or whatever

visual bronze
#

im keeping it as a normal numnber

#

im going insane

#

mee soon

limpid swallow
#

cool then continue keeping it as a normal number