Aruna Posted November 4, 2014 Share Posted November 4, 2014 Porque me sale Este error tan seguido?? local checkframes=0 local ShowPanel local mapname fps=99 ping=0 hours=0 minutes=0 frames,lastsec=0,0,0 localPlayer = getLocalPlayer() font = {} font[1] = guiCreateFont( "font.ttf", 12 ) function checkInfo () --FRAME local frameticks=getTickCount() frames=frames+1 if frameticks-1000>lastsec then local prog=(frameticks-lastsec) lastsec=frameticks fps=frames/(prog/1000) frames=fps*((prog-1000)/1000) guiSetText (FPSlabel, "FPS: " .. fps) end --PING ping = getPlayerPing(getLocalPlayer()) guiSetText (Pinglabel, "| Ping: " .. ping .. " | ") --[[TIME rtime = getRealTime() hours = rtime.hour minutes = rtime.minute guiSetText (Timelabel, hours .. ":" .. minutes .. " | ") ]] end function InfoOff () guiSetVisible(OnOf, false) guiSetVisible(allINone, false) guiSetVisible(FBlabel, false) end addCommandHandler ( "fpoff", InfoOff) function InfoOn () guiSetVisible(OnOf, true) guiSetVisible(allINone, true) guiSetVisible(FBlabel, true) end addCommandHandler ( "fpon", InfoOn) addEventHandler('onClientResourceStart', resourceRoot, function() sWidth, sHeight = guiGetScreenSize() OFpos = math.floor(sWidth - 180) OFFpos = math.floor(sWidth - 370) --Timelabel = guiCreateLabel(3, 3, 70, 23," | " .. hours .. ":" .. minutes, false) FPSlabel = guiCreateLabel(49, 3, 42 , 23,"FPS:" .. fps, false) Pinglabel = guiCreateLabel(95, 3, 70, 23,"PING: " .. ping .. " | ", false) --allINone = guiCreateLabel(508, 5, 800, 290, "Loading informations...", false) -- allINone = guiCreateLabel(600, 3, 1000, 290,"Loading informations...", false) -- guiLabelSetColor(allINone,58, 190, 87) -- guiSetFont(allINone,font[1]) end ) function WriteToLine () guiSetText(allINone, "FPS: " .. string.gsub(fps,"%.%d*","") .. " | " .. "PING: " .. ping .."") end addEventHandler ( "onClientRender", root, checkInfo) addEventHandler ( "onClientRender", root, WriteToLine) addEventHandler ("onClientMapStarting", root ,checkmapname) Link to comment
Tomas Posted November 4, 2014 Share Posted November 4, 2014 Ese error quiere decir que el primer argumento de guiSetText returna nil, el problema se debe a que ese GUI-Element LUA lo ignora porque tiene dos guiones delante (--), quita los guiones y no habrá problema. Link to comment
Recommended Posts