#zombie lvl
1 messages · Page 1 of 1 (latest)
add 1 to {example::%player%} or example::player's uuid} for individual
how would i do the function
function functionname(ID: type:)
there's also a functions tutorial pinned in #skript-help-2
no like ik how to do functions but how do i display it as superscirpt
replace all 1 with ¹, etc
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
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%}```
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 ...
??
what in string
like ik how to put smth in a string but like where and what do i put in a string
set a local variable to the stringified variable
can u explain it a little better i still dont get it
set {_string} to "%{example::number}%"
ok so i set a local var to to the superscript var and then im replacing all 1 with lets say {_superscript::1}?
replace 1 with ¹ in the string variable, not the number variable
.
wdym with ...
it means I got lazy
just continue the line
(its the same as what you already have)
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?
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
what var
the one you need to set
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
.
no thats your number
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}
where you had the number
you need to have a string there, not a number
wait so i set a var to 1 and i set the other var to the super scirpt
ohh wait so i keep the re[;ace thing and i just set a var to 1
the replace effect only works with strings
so i dont use replace
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%}```
nonononono
this is the number: {beacon-grab::user::lvl::%{_p}'s uuid%}
you need to set THAT to a string
hm but how
and there's no need to do each one separately
replace all "a" with "A" in {_s}```
cant i just do them seperatly bc i dont understamd loops
????? 😢
i dont get it still:(
set {_string} to "%{_number}%"
replace all "1" with "2" in {_string}
broadcast {_string}```
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}```
did i do it right
you still need to return it, but yeah
also, there's no need for the local variables
just replace all "%{_1}%" -> replace all "1"
ohh ok ill tru
but i still really recommend the loop, much cleaner
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
youre modifying a variable and then doing nothing with it
.
wait how do i set the lvl var to the string niw
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
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
well yeah, read the code slowly and try and figure out why
.
still i dont get it
because how are you supposed to add a number to a string
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
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
man i dont get can anybody clearly tell me what to do npw with idk skript or smth
just keep it as a number
make the function return {_string}, and use that when you want to display it
then only use the function when you need to show it in your custom format or whatever
cool then continue keeping it as a normal number