• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ [MOVEMENTS] How to change Seconds to Hours and Minutes together!

Hyagosrs

Member
Joined
Mar 10, 2018
Messages
94
Solutions
1
Reaction score
11
i have this movements scripts that shows me how much time i have to access a boss again when StepIn.. but it shows me in seconds, i want to show me in hours and minutes together!!!

Lua:
function onStepIn(cid, item, position, fromPosition)
     if getPlayerStorageValue(cid, 8087) ~= 1 then
         doPlayerSendCancel(cid, "you need to wait " ..getPlayerStorageValue(cid, 8087) - os.time() .." seconds access this boss again.")
         doTeleportThing(cid, fromPosition)
     end
     return true
end

please help me !!
Post automatically merged:

who wants to know, this script works perfectly
Lua:
       function onStepIn(cid, item, position, fromPosition)
        local time = getPlayerStorageValue(cid, 8088) - os.time()
         local hours, minutes, seconds = math.floor (time / 3600), math.floor ((time - ((math.floor (time / 3600)) * 3600))/ 60), time - ((math.floor (time/60)) * 60)
         if time >= 3600 then
             text = hours.." "..(hours > 1 and "hours" or "hour")..", "..minutes.." "..(minutes > 1 and "minutes" or "minute").." and "..seconds.." "..(seconds > 1 and "seconds" or "second")
         elseif time >= 60 then
             text = minutes.." "..(minutes > 1 and "minutes" or "minute").." and "..seconds.." "..(seconds > 1 and "seconds" or "second")
         else
             text = seconds.." "..(seconds > 1 and "seconds" or "second")
         end
         if getPlayerStorageValue(cid, 8088) > 1 then
         doPlayerSendCancel(cid, "You need to wait "..text.." seconds to access this boss again.")
         doTeleportThing(cid, fromPosition)
     end
     return true
end
 
Last edited:
Back
Top