#If integer ends in (certain number)

1 messages · Page 1 of 1 (latest)

rare spoke
#

Hi, i'm currently developing a killstreak system and can't find out how to detect if a number ends in 0; for example 10, 20, 100, 110 etc

Instead of doing if {killstreak::%player's uuid%} is 10: ... if {killstreak::%player's uuid%} is 20:' so on and so on, and bumping it up every 10 numbers, is there a like a math way to detect if the number ends in 0

any help is appreciated

warm willow
#

If {killstreak::%player’s uuid%} is 0
Set var to <killstreak thingy>

On death of player
If <attacker’s killstreak> - var = 10
Set <attacker’s killstreak> to var
#do whatever you want here

#

Note: <killstreak> is the {} thing you have, too lazy to type that out

#

But that’s the general idea

#

Just replace var with a var::player’s uuid

ivory patio
#

Easy way to check would be to make it a string and check the last char

primal sun
#

boolean 🤓

#

string

#

🤓

#

make function that returns a string

ivory patio
#

What

primal sun
#

add the diameter

#

to the string

#

and then you got it

long obsidian
#

wtf

#

mod({var},10) = 0

ivory patio
#

Oh, yeah mod works too

#

Forgot about that lol

rare spoke
warm willow
primal sun
wooden anvil
#

Easiest solution by far

long obsidian
#

though not valid syntax

#

skript does not use % for modulo

wooden anvil
#

I'm not giving syntax, I'm giving idea

long obsidian
#

k