Jump to content

Recommended Posts

  • Active Member
local time = os.date("%M")
 
local event_time = time - 60
 
So actually if i use this time - number and number is bigger than os.date("%M") i'm getting a crash and a negative result
 
Example:
 
os.date("%M") = 40
number = 50
 
I'm getting result -10 instead of 10
 
Any solution ? math.floor or something ?
Link to comment
https://metin2.dev/topic/6472-osdatem-50/
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

  • Premium

Hmm if I understand you well, your problem is just you sometimes get negative number, and its can not be converted to time format. So if this is the problem, try to use math.abs(number). This will convert all numbers to its absolute value.

The one and only UI programming guideline

Link to comment
https://metin2.dev/topic/6472-osdatem-50/#findComment-41093
Share on other sites

  • Active Member

I'm getting the correct result but negative only when the number is bigger than the actual time(minute)

Link to comment
https://metin2.dev/topic/6472-osdatem-50/#findComment-41094
Share on other sites

  • 1 year later...
  • Honorable Member

Use math.abs.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/6472-osdatem-50/#findComment-80767
Share on other sites

  • Honorable Member

oh lol.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/6472-osdatem-50/#findComment-80769
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.