#coins go to "k , m , b , t , q , Q , s , S"

1 messages · Page 1 of 1 (latest)

copper nova
#

Many, many, many snippets exist for this in #skript-snippets, or you can make your own

stiff ether
# copper nova Many, many, many snippets exist for this in <#787794379694800926>, or you can ma...

do i just put it in the skript?

function unformat(number: string) :: number:
    set {_s::*} to "|K|M|B|T|QD|QN|SX|SP|O|N|DE|UD|DD|TDD|QDD|QND|SXD|SPD|OCD|NVD|VGN|UVG|DVG|TVG|QTV|QNV|SEV|SPG|OVG|NVG|TGN|UTG|DTG|TSTG|QTTG|QNTG|SSTG|SPTG|OCTG|NOTG|QDDR|UQDR|DQDR|TQDR|QDQDR|QNQDR|SXQDR|SPQDR|OQDDR|NQDDR|QQGNT|UQGNT|DQGNT|TQGNT|QDQGNT|QNQGNT|SXQGNT|SPQGNT|OQQGNT|NQQGNT" split at "|"
  set {_n::*} to (regex {_number} split at "(?<=[0-9])(?=[A-Za-z])+")
  return ({_n::1} parsed as number) if {_n::2} isn't set
  set {_index} to 1
  while (uppercase {_n::2}) != {_s::%{_index}%}:
    add 1 to {_index}
    set {_output} to (({_output} ? ({_n::1} parsed as number)) * 1000)
    stop if {_index} > 61
  return {_output}
#

without doing anything or i need to do something

granite bramble
#

Thats an unformatter, so it will take 1.2K and turn it into 1200

#

Im assuming you want the opposite, where it takes 1200 and turns into 1.2K

stiff ether
#

yess

granite bramble
#

Here's the one I made
#skript-snippets message

granite bramble
#

?

stiff ether
#
every second:
    loop all players:
        if loop-player's tool is a wooden hoe with lore "&f&lsᴛᴀᴛɪsᴛɪᴄs:" and "&7Level: &f%{level::%player%}%" and "&f%{xp::%player%}%/%{xp_required::%player%}%":
            set {_xp} to {_player}'s {xp.%_player%}
            set {_xp_required} to {_player}'s {xp_required.%_player%}
            set {_level} to {_player}'s {level.%_player%}
            set lore of {_player}'s tool to "&f&lsᴛᴀᴛɪsᴛɪᴄs:" and "&7Level: &f%{_level}%" and "&f%{_xp}%/%{xp_required}%"
#

error ^

granite bramble
#

ok so first off, looping all players, every second, is like a really bad idea, depending on how many players you have, can lag or even crash the server

stiff ether
#

so what can i do..

#

cause i want to make it so that when i break a wheat i gain 1 xp and this part of the skript updates that.

#

also this

#

get a warning

granite bramble
#

you can just change it to

set {-Suffixes::*} to "K","M","B","T","Qd" and "Qn"
granite bramble
#

But for changing the xp of the tool, it would be best to change the lore, when you give the player xp

#

I would suggest making a function

stiff ether
#

i see

#

but i got a lot of ram on that

#

so i am fine

#

how could i fix it like what player shall i write

granite bramble
#

wdym?

stiff ether
#

like

#

how can i fix the error

#

cause i got a lot of ra,

#

ram

granite bramble
#

What error?

stiff ether
granite bramble
#

oh so when ever you loop data/classinfo it has to be prefixed with loop- so in this case youre looping players (a type of data/classinfo)
So inside the loop, you will use loop-player

#

instead of player

stiff ether
#
every second:
    loop all players:
        if loop-player's tool is a wooden hoe with lore "&f&lsᴛᴀᴛɪsᴛɪᴄs:" and "&7Level: &f%{level::%loop-player%}%" and "&f%{xp::%loop-player%}%/%{xp_required::%loop-player%}%":
            set {_xp} to {loop-player}'s {xp.%loop-player%}
            set {_xp_required} to {_player}'s {xp_required.%loop-player%}
            set {_level} to {loop-player}'s {level.%loop-player%}
            set lore of {loop-player}'s tool to "&f&lsᴛᴀᴛɪsᴛɪᴄs:" and "&7Level: &f%{_level}%" and "&f%{_xp}%/%{xp_required}%"
#

better?

copper nova
#

no

#

dont loop all players every second

#

honestly just on tool change

stiff ether
#

wym?

copper nova