Solved Remove decimal place from cooldown time

  • 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 comminuty!

    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.

Nick

New Member
Jan 27, 2017
8
0
1
How would i change my cooldown from "2 minutes and 30.44 seconds" to just "30 seconds"

set {_waited} to difference between {globalbooster} and now
if {_waited} is less than 60 minutes:
set {_time} to difference between 60 minutes and {_waited}

Thanks

Also i know you could do this within the config but that would mess up anything else which i need decimal places for
 
1 minute = 60 seconds // so 1 minute and 33 seconds = 93 seconds


if {_waited} is less than 93 seconds:
 
Try this:
Code:
set {_str} to "%{_time}%"
set {_l::*} to split {_str} at " "
loop {_l::*}:
    delete {_i}
    set {_i} to loop-value parsed as a number
    {_i} is set
    set {_i} to round({_i})
    replace every "%loop-value%" in {_str} with "%{_i}%"
message "Cooldown time: %{_str}%"
 
Try this:
Code:
set {_str} to "%{_time}%"
set {_l::*} to split {_str} at " "
loop {_l::*}:
    delete {_i}
    set {_i} to loop-value parsed as a number
    {_i} is set
    set {_i} to round({_i})
    replace every "%loop-value%" in {_str} with "%{_i}%"
message "Cooldown time: %{_str}%"
Already got it working with something pretty much the same as this but forgot to reply, anyway thanks
 
Status
Not open for further replies.