Solved round function of skript 2.4 how to use

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Mich7272

Member
Apr 12, 2019
49
0
0
spigot: 1.14.1
skript: 2.4 beta
code
Code:
command /ftest:
    trigger:
        spawn a zombie
        equip the last spawned zombie with leather helmet
        set {_test} to a random number between 10 and 25
        message "%{_test}%"
        round({_test})
        wait a tick
        message "%{_test}%"
        set the last spawned zombie's max health to {_test}
        set last spawned zombie's health to 999
        wait 0.1 second   
        set the last spawned zombie's display name to "&c%last spawned zombie's health%"
So this is the function I am trying to use https://skriptlang.github.io/Skript/functions.html#round
now random number between 10 and 25 gives doubles number (like for example 24.44 or 11.25) and the functions explain something like this round(2.34) = 2
and I don't know how to use this I don't get it please help me
 
spigot: 1.14.1
skript: 2.4 beta
code
Code:
command /ftest:
    trigger:
        spawn a zombie
        equip the last spawned zombie with leather helmet
        set {_test} to a random number between 10 and 25
        message "%{_test}%"
        round({_test})
        wait a tick
        message "%{_test}%"
        set the last spawned zombie's max health to {_test}
        set last spawned zombie's health to 999
        wait 0.1 second  
        set the last spawned zombie's display name to "&c%last spawned zombie's health%"
So this is the function I am trying to use https://skriptlang.github.io/Skript/functions.html#round
now random number between 10 and 25 gives doubles number (like for example 24.44 or 11.25) and the functions explain something like this round(2.34) = 2
and I don't know how to use this I don't get it please help me
the function will give back a whole number (integer), but rather than getting a random number then rounding it, just get a random integer
ex:
code_language.skript:
set {_r} to random integer between 10 and 25
 
the function will give back a whole number (integer), but rather than getting a random number then rounding it, just get a random integer
ex:
code_language.skript:
set {_r} to random integer between 10 and 25
yeah but how I use the function? because there are a lot of functions and I wanna know how to use it
 
Status
Not open for further replies.