#Need help with a format
1 messages · Page 1 of 1 (latest)
There’s about 100 snippets that format timespans in #skript-snippets
You can also do some math or use (hour|minute|second)s of %timespan% to do make your own
I ain't really advanced with skript could u please just give me the timer all i need is smh to show the time in a variable (use 3 if u want) then once it reachs 0 to broadcast "test" & reset
Im not going to do it foe you. There’s pre-made snippets though.
You could probably also just use “%seconds of %timespan%% seconds”
so on load: set {kothtimer} to 400 #test not actual thing every 1 second: remove 1 from {kothtimer} # code for just a example send "%hours of %timespan%% hours %minutes of %timespan%% %seconds of %timespan%%" to player
huh?
And you need to fix the indentation
so %hours of {kothtimer}% ?
Mhmm
mm lemme test
But then when you get minutes that will be included as well
So it will say like 61min instead of 1
So you need to remove the hours once you get them
how would i do that
remove %timespan% from {_yourTimespan}
so remove mintes from {kothtimer} ?
how would i check if the variable goes into minutes tho
or could i just make it like if there is 59 min it would just put hours to 0
Also i put the result to it it just says %hours of {kothtimer}% could not be found
look at the snippets for examples
please stop pinging me
you can set a local var to the seconds, then do some math
snippets go on forever how do i search em
also what local var would i use
the search on discord or skunity website...
.
sobs i'm horrible at tis
set {_seconds} to seconds of {_timespan} #: should be 3710
#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}```
repeat as needed
mm
set {_seconds} to seconds of {_timespan} #: should be 3710
#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}```?
but how would i make it execute after it ended
this means you need to do math for the minutes, etc
days, hours, minutes, whatever you want to display
#skript-snippets message
remove {_time::days}*86400 from {_timespan}
set {_time::hours} to floor({_timespan}/3600)
remove {_time::hours}*3600 from {_timespan}
set {_time::minutes} to floor({_timespan}/60)
remove {_time::minutes}*60 from {_timespan}
set {_time::seconds} to {_timespan}```
is what i use
mm
then just loop {_time::*}:, and use the index and value
so set {_timespan} to 2 hours, 59 minutes, 60 seconds
set {_seconds} to seconds of {_timespan} #: should be 3710
#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}
mm
so then for minutes i copy last 2 lines
then same for seconds
but how do i display it @tawdry hornet last ping dw
literally just put it in a message
birdy please format its hard for a phone user
ok
set {_seconds} to seconds of {_timespan} #: should be 3710
#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}```
use that and display {_timespan}
k
that wouldnt work
wait so how
you nedd to display each variable
you would need to use %{_time::days}% days, %{_time::hours}% hours, ...
yes
or
how would i like make it so once the time is up it resets & starts again
if seconds is 0
use a periodical or something
k
uh it just shows <none>
trigger:
set {_timespan} to 2 hours, 59 minutes, 60 seconds
set {_seconds} to seconds of {_timespan} #: should be 3710
#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}```
then i set it it just shows <none>
oh i using on placeholderapi placeholder request for the prefix "kothtimer": set result to "%{_hours}% %{_minutes}% %{_seconds}%"
it works fine it just means the variables are = 0
you cant use local variables across events
bru
And I wouldnt define vars in a command and then get them
I would just put the code into the placeholder, that way the command doesnt need to be run every time you want to get the placeholder
huh?
how
my whole code is ```on placeholderapi placeholder request for the prefix "kothtimer":
set result to "%{_hours}% %{_minutes}% %{_seconds}%"
command /test:
trigger:
set {_timespan} to 2 hours, 59 minutes, 60 seconds
set {_seconds} to seconds of {_timespan} #: should be 3710
#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}
set {_minutes} to floor({_seconds}/3600)
remove {_minutes}*3600 from {_seconds}``` rn
ohh
set result to "%{_hours}% %{_minutes}% %{_seconds}%"
set {_timespan} to 2 hours, 59 minutes, 60 seconds
set {_seconds} to seconds of {_timespan} #: should be 3710
#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}
set {_minutes} to floor({_seconds}/3600)
remove {_minutes}*3600 from {_seconds}```
it still showing <none>
how would i fix
very last ping..
because you are sending the result before setting the variables...
mm
how about just not pinging me at all?
ill respond when I'm able to, no need to be impatient
ok so i'm seeing it says 3 0 0 but if i request the placeholder in more then 1 area would it malfunction?
also i wanted it to like be 3 hours, then it would show 2 hours 5 minutes & 49 seconds but it aint doing that
its always gonna return 3 0 0, because you're setting it every time you try to get it
also i wanted it to like be 3 hours, then it would show 2 hours 5 minutes & 49 seconds but it aint doing that
i rlly wanted this cuz it would look cool, but ig i won't have a hologram showing how long till it starts
i prob wont add it anymore unless some1 can make it for me
just set a global variable to the time it was started
then use time since {} in your placeholder
So smh like set {kothtimer} to 2 hours, 59 minutes, 59 seconds then smh like send "time since {kothtimer} to player ?
frfr
okay.
It would take you 2 seconds to learn how to use the discord search feature and check snippets
There is tons of examples
sobs me dumb
#skript-snippets
#skript-snippets message
its right there
for a minigame
just repurpose it
@finite ocean doesnt work
just shows <none> & i tryd setting it
Ya called it wrong.
Maybe 
solved?
u would need to replace %timespan% with ur actual timepsan
🤦
sorry for being late
^
the grammer is crazy tho
fr
now go look at shanes first msgs