• UTime HUD
    2 replies, posted
When i add UTime to my hud i get this error: this is my code: Top of file cl_hud.lua [CODE] function timeToStr( time ) local tmp = time local s = tmp % 60 tmp = math.floor( tmp / 60 ) local m = tmp % 60 tmp = math.floor( tmp / 60 ) local h = tmp % 24 tmp = math.floor( tmp / 24 ) local d = tmp % 7 local w = math.floor( tmp / 7 ) return string.format( "%02iw %id %02ih %02im %02is", w, d, h, m, s ) end [/CODE] in one of the bars [CODE] local timeplayed = timeToStr( LocalPlayer():GetUTimeTotalTime() ) BarDesign( timeplayed, "Time Played", x, y, w, 12, Color( 39, 174, 96, 255 ) ) [/CODE] [CODE] [lol jeg er en freak|2|STEAM_0:0:81236825] Lua Error: [ERROR] addons/darkrpmodification/lua/darkrp_modules/fg_hud/cl_hud.lua:122: attempt to compare number with string 1. BarDesign - addons/darkrpmodification/lua/darkrp_modules/fg_hud/cl_hud.lua:122 2. fn - addons/darkrpmodification/lua/darkrp_modules/fg_hud/cl_hud.lua:251 3. unknown - addons/ulib/lua/ulib/shared/hook.lua:110 [/CODE]
What are lines 251 and 122? (Please provide the function, or part of the function, that includes the line, not JUST the line)
Nevermind i figured it out!
Sorry, you need to Log In to post a reply to this thread.