Jump to content

[HELP]:attempt to compare number with boolean


India

Recommended Posts

Hello Community,anyone can help me? I get this error: client.lua:13: attempt to compare number with boolean

 

local screenWidth,screenHeight = guiGetScreenSize()

local last_ping = 0
local alpha = false

function createText1 ( )
	if (getElementData (localPlayer, "hideTable") or {}).icons then return true end

    if getElementData(getLocalPlayer(), "brokenbone", true) then
    dxDrawImage(screenWidth * 0.94, screenHeight * 0.73, screenHeight * 0.065, screenHeight * 0.065, "brokenbone.png", 0, 0, 0, tocolor(255, 255, 255))
    end
------------------------------- BLOOD -------------------------------
    if getElementData(getLocalPlayer(), "blood") >= 10000 and getElementData(getLocalPlayer(), "blood") <= 12000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
    if getElementData(getLocalPlayer(), "blood") >= 8000 and getElementData(getLocalPlayer(), "blood") <= 10000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/4.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 6000 and getElementData(getLocalPlayer(), "blood") <= 8000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/3.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 4000 and getElementData(getLocalPlayer(), "blood") <= 6000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/2.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 2000 and getElementData(getLocalPlayer(), "blood") <= 4000 then
    elementblood2 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/1.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 100 and getElementData(getLocalPlayer(), "blood") <= 2000 then
    elementblood2 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/0.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "bleeding") > 0 then
	dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/bleeding.png", 0, 0, 0, tocolor(210, 10, 16))
	end	
	if getElementData(getLocalPlayer(), "infection") then
	  dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "infection.png", 0, 0, 0, tocolor(255, 0, 0,fading))
    end   	

	
------------------------------- BLOOD -------------------------------
------------------------------- food -------------------------------
    if getElementData(getLocalPlayer(), "food") >= 80 and getElementData(getLocalPlayer(), "food") <= 100 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
    if getElementData(getLocalPlayer(), "food") >= 60 and getElementData(getLocalPlayer(), "food") <= 80 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/4.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 40 and getElementData(getLocalPlayer(), "food") <= 60 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/3.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 20 and getElementData(getLocalPlayer(), "food") <= 40 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/2.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 10 and getElementData(getLocalPlayer(), "food") <= 20 then
    elementblood2 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/1.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 0 and getElementData(getLocalPlayer(), "food") <= 10 then
    elementblood2 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/0.png", 0, 0, 0, tocolor(162, 161, 161))
    end
------------------------------- food -------------------------------
------------------------------- drink -------------------------------
    if getElementData(getLocalPlayer(), "thirst") >= 80 and getElementData(getLocalPlayer(), "thirst") <= 100 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
    if getElementData(getLocalPlayer(), "thirst") >= 60 and getElementData(getLocalPlayer(), "thirst") <= 80 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/4.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 40 and getElementData(getLocalPlayer(), "thirst") <= 60 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060,"drink/3.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 20 and getElementData(getLocalPlayer(), "thirst") <= 40 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/2.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 10 and getElementData(getLocalPlayer(), "thirst") <= 20 then
    elementblood2 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/1.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 0 and getElementData(getLocalPlayer(), "thirst") <= 10 then
    elementblood2 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/0.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	------------------------------- TEMPERATURA -------------------------------
   dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t2.png", 0, 0, 0, tocolor(162, 161, 161))
  
    if getElementData(getLocalPlayer(), "temperature") <=35 then
	elementtemp2 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
  
   if getElementData(getLocalPlayer(), "temperature") >= 35 and getElementData(getLocalPlayer(), "temperature") <=36 then
	elementtemp2 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t4.png", 0, 0, 0, tocolor(162, 161, 161))
    end

    if getElementData(getLocalPlayer(), "temperature") >= 36 and getElementData(getLocalPlayer(), "temperature") <=37 then
	elementtemp4 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161))
    end

    if getElementData(getLocalPlayer(), "temperature") >= 37 and getElementData(getLocalPlayer(), "temperature") <=38 then
	elementtemp = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161))
    end

    if getElementData(getLocalPlayer(), "temperature") >= 38 then
	elementtemp = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161))
    end

-------------------------------FPS-------------------------------
	if getElementData(getLocalPlayer(), "FPS") >= 35 and getElementData(getLocalPlayer(), "FPS") <=45 then
    dxDrawImage(screenWidth*0.94, screenHeight * 0.635, screenHeight * 0.065, screenHeight * 0.065, "net2.png", 0, 0, 0, tocolor(255, 255, 0,fading))
	end			
	if getElementData(getLocalPlayer(), "FPS") >= 50 and getElementData(getLocalPlayer(), "FPS") <=60 then
    dxDrawImage(screenWidth*0.94, screenHeight * 0.635, screenHeight * 0.065, screenHeight * 0.065, "net3.png", 0, 0, 0, tocolor(92, 141, 71,fading))
	end		
	if getElementData ( localPlayer, "clothHead" ) and getElementData ( localPlayer, "clothHead" ) ~= 0 then
		dxDrawImage(screenWidth * 0.90, screenHeight * 0.81, screenHeight * 0.065, screenHeight * 0.065, "bpvest1.png", 0, 0, 0, tocolor(162, 161, 161,fading) )
	end
	if getElementData ( localPlayer, "clothBody" ) and getElementData ( localPlayer, "clothBody" ) ~= 0 then
		dxDrawImage(screenWidth * 0.94, screenHeight * 0.81, screenHeight * 0.065, screenHeight * 0.065, "bpvest.png", 0, 0, 0, tocolor(162, 161, 161,fading) )
	end
end		


function HandleTheRendering ( )
 if render then
    removeEventHandler ( "onClientRender", root, createText1 )
    render = false
 else
   addEventHandler ( "onClientRender", root, createText1 )
   render = true
 end
end
addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )  

fileDelete ( "client.lua" )
	
	
local root = getRootElement()
local player = getLocalPlayer()
local counter = 0
local starttick
local currenttick
addEventHandler("onClientRender",root,
	function()
		if not starttick then
			starttick = getTickCount()
		end
		counter = counter + 1
		currenttick = getTickCount()
		if currenttick - starttick >= 1000 then
			setElementData(player,"FPS",counter)
			counter = 0
			starttick = false
		end
	end
)

function drawStates ()
	addEventHandler ( "onClientRender", root, pingFpsCiz )
end
addEventHandler ( "onClientResourceStart", resourceRoot, drawStates )

function pingFpsCiz()
	if getElementData(getLocalPlayer(),"logedin") then

		local sx, sy = guiGetScreenSize()

		local wx = 106
		local wy = 858
		local px = (sx-wx)
		local py = (sy-wy)
        --dxDrawText("FPS: "..getElementData(getLocalPlayer(),"FPS").." | PING: "..getPlayerPing(getLocalPlayer()), px, py, 100, 100, tocolor(255, 255, 255), 1, "default", "left", "top", false, false, false, true, false)
	end
end

 

Link to comment
6 minutes ago, Tekken said:

Add this at the very top of the onClientRender event

if getElementData(getLocalPlayer(),"logedin") then

That happens because the player it's not yet logged in thus it doesn't have the "blood" element data set to it!

can you add it? i didn't got it

Link to comment
function createText1 ( )
  if getElementData(localPlayer, "logedin") then 
	if (getElementData (localPlayer, "hideTable") or {}).icons then return true end

    if getElementData(getLocalPlayer(), "brokenbone", true) then
    dxDrawImage(screenWidth * 0.94, screenHeight * 0.73, screenHeight * 0.065, screenHeight * 0.065, "brokenbone.png", 0, 0, 0, tocolor(255, 255, 255))
    end
------------------------------- BLOOD -------------------------------
    if getElementData(getLocalPlayer(), "blood") >= 10000 and getElementData(getLocalPlayer(), "blood") <= 12000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
    if getElementData(getLocalPlayer(), "blood") >= 8000 and getElementData(getLocalPlayer(), "blood") <= 10000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/4.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 6000 and getElementData(getLocalPlayer(), "blood") <= 8000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/3.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 4000 and getElementData(getLocalPlayer(), "blood") <= 6000 then
	elementblood1 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/2.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 2000 and getElementData(getLocalPlayer(), "blood") <= 4000 then
    elementblood2 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/1.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "blood") >= 100 and getElementData(getLocalPlayer(), "blood") <= 2000 then
    elementblood2 = dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/0.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "bleeding") > 0 then
	dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "blood/bleeding.png", 0, 0, 0, tocolor(210, 10, 16))
	end	
	if getElementData(getLocalPlayer(), "infection") then
	  dxDrawImage(screenWidth * 0.86, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "infection.png", 0, 0, 0, tocolor(255, 0, 0,fading))
    end   	

	
------------------------------- BLOOD -------------------------------
------------------------------- food -------------------------------
    if getElementData(getLocalPlayer(), "food") >= 80 and getElementData(getLocalPlayer(), "food") <= 100 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
    if getElementData(getLocalPlayer(), "food") >= 60 and getElementData(getLocalPlayer(), "food") <= 80 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/4.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 40 and getElementData(getLocalPlayer(), "food") <= 60 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/3.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 20 and getElementData(getLocalPlayer(), "food") <= 40 then
	elementblood1 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/2.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 10 and getElementData(getLocalPlayer(), "food") <= 20 then
    elementblood2 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/1.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "food") >= 0 and getElementData(getLocalPlayer(), "food") <= 10 then
    elementblood2 = dxDrawImage(screenWidth * 0.94, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "food/0.png", 0, 0, 0, tocolor(162, 161, 161))
    end
------------------------------- food -------------------------------
------------------------------- drink -------------------------------
    if getElementData(getLocalPlayer(), "thirst") >= 80 and getElementData(getLocalPlayer(), "thirst") <= 100 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
    if getElementData(getLocalPlayer(), "thirst") >= 60 and getElementData(getLocalPlayer(), "thirst") <= 80 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/4.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 40 and getElementData(getLocalPlayer(), "thirst") <= 60 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060,"drink/3.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 20 and getElementData(getLocalPlayer(), "thirst") <= 40 then
	elementblood1 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/2.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 10 and getElementData(getLocalPlayer(), "thirst") <= 20 then
    elementblood2 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/1.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	if getElementData(getLocalPlayer(), "thirst") >= 0 and getElementData(getLocalPlayer(), "thirst") <= 10 then
    elementblood2 = dxDrawImage(screenWidth * 0.90, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "drink/0.png", 0, 0, 0, tocolor(162, 161, 161))
    end
	------------------------------- TEMPERATURA -------------------------------
   dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t2.png", 0, 0, 0, tocolor(162, 161, 161))
  
    if getElementData(getLocalPlayer(), "temperature") <=35 then
	elementtemp2 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t5.png", 0, 0, 0, tocolor(162, 161, 161))
    end
  
   if getElementData(getLocalPlayer(), "temperature") >= 35 and getElementData(getLocalPlayer(), "temperature") <=36 then
	elementtemp2 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t4.png", 0, 0, 0, tocolor(162, 161, 161))
    end

    if getElementData(getLocalPlayer(), "temperature") >= 36 and getElementData(getLocalPlayer(), "temperature") <=37 then
	elementtemp4 = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161))
    end

    if getElementData(getLocalPlayer(), "temperature") >= 37 and getElementData(getLocalPlayer(), "temperature") <=38 then
	elementtemp = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161))
    end

    if getElementData(getLocalPlayer(), "temperature") >= 38 then
	elementtemp = dxDrawImage(screenWidth * 0.82, screenHeight * 0.900, screenHeight * 0.060, screenHeight * 0.060, "temperature/t3.png", 0, 0, 0, tocolor(162, 161, 161))
    end

-------------------------------FPS-------------------------------
	if getElementData(getLocalPlayer(), "FPS") >= 35 and getElementData(getLocalPlayer(), "FPS") <=45 then
    dxDrawImage(screenWidth*0.94, screenHeight * 0.635, screenHeight * 0.065, screenHeight * 0.065, "net2.png", 0, 0, 0, tocolor(255, 255, 0,fading))
	end			
	if getElementData(getLocalPlayer(), "FPS") >= 50 and getElementData(getLocalPlayer(), "FPS") <=60 then
    dxDrawImage(screenWidth*0.94, screenHeight * 0.635, screenHeight * 0.065, screenHeight * 0.065, "net3.png", 0, 0, 0, tocolor(92, 141, 71,fading))
	end		
	if getElementData ( localPlayer, "clothHead" ) and getElementData ( localPlayer, "clothHead" ) ~= 0 then
		dxDrawImage(screenWidth * 0.90, screenHeight * 0.81, screenHeight * 0.065, screenHeight * 0.065, "bpvest1.png", 0, 0, 0, tocolor(162, 161, 161,fading) )
	end
	if getElementData ( localPlayer, "clothBody" ) and getElementData ( localPlayer, "clothBody" ) ~= 0 then
		dxDrawImage(screenWidth * 0.94, screenHeight * 0.81, screenHeight * 0.065, screenHeight * 0.065, "bpvest.png", 0, 0, 0, tocolor(162, 161, 161,fading) )
	end
    end
end	

 

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...