Jump to content

dxDrawText help


spoty

Recommended Posts

i have edited my drift ranks and now i have this kinda wierd error

drft.lua:127 attempt to compare number with nil  
drft.lua:156 attempt to concatenate a boolean value 

this is the part

    if tick - (idleTime or 0) < 3000 then 
        local temp = "DRIFT" 
        if score >= 1500000 then 
            temp = "DRIFT\n\nDrift King!" 
        elseif score >= 750000 then 
            temp = "DRIFT\n\nProfessional Drifter!" 
        elseif score >= 300000 then 
            temp = "DRIFT\n\nAllmost Pro!" 
        elseif score >= 150000 then 
            temp = "DRIFT\n\nFuck Ye!" 
        elseif score >= 70000 then 
            temp = "DRIFT\n\nBro dont stop now!" 
        elseif score >= 30000 then 
            temp = "DRIFT\n\nJust keep it up!" 
        elseif score >= 10000 then 
            temp = "DRIFT\n\nGood Drifter for Beginner!" 
        end 
        dxDrawText(temp, x1,y1,x2,y2, TempCol, 2.2, "arial","center","top", false,true,false) 
        dxDrawText(string.format("\n%d",screenScore),  x1,y1-10,x2,y2, TempCol, size, "pricedown","center","top", false,true,false) 
        local screenMoney = math.floor (screenScore / 70) 
        dxDrawText("\n\n\n\nAwards: $"..screenMoney, 20,155,screenWidth,screenHeight, Red, 1.2, "arial","left","top", false,true,false) 
        local bdrift = getElementData(player, "bdrift") 
        if tonumber(bdrift) >= 3500000 then  -------- line 127 
            rank = "Server Drift King" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) >= 1500000 and tonumber(bdrift) < 1500000 then 
            rank = "Drift King" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) >= 750000 and tonumber(bdrift) < 1500000 then 
            rank = "Crazy Drifter" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) >= 300000 and tonumber(bdrift) < 750000 then 
            rank = "Street Drifter" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) >= 150000 and tonumber(bdrift) < 300000 then 
            rank = "Ultimate Drifter" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) >= 70000 and tonumber(bdrift) < 150000 then 
            rank = "Super Drifter" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) >= 30000 and tonumber(bdrift) < 70000 then 
            rank = "Track Monster" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) >= 10000 and tonumber(bdrift) < 30000 then 
            rank = "Beginner" 
            setElementData(player, "driftrank", rank) 
        elseif tonumber(bdrift) < 10000 then 
            rank = "Newbie" 
            setElementData(player, "driftrank", rank) 
        end 
    end 
    dxDrawText("\n\n\nRank: "..getElementData(player, "driftrank"), 20,155,screenWidth,screenHeight, Red, 1.2, "arial","left","top", false,true,false)  ---- line 156 
end 
Link to comment
Which are those lines!
  if tonumber(bdrift) >= 3500000 then  -------- line 127 
            rank = "Server Drift King" 
            setElementData(player, "driftrank", rank) 
  
  
    dxDrawText("\n\n\nRank: "..getElementData(player, "driftrank"), 20,155,screenWidth,screenHeight, Red, 1.2, "arial","left","top", false,true,false)  ---- line 156 
  

if you looked good you already saw them :P

Link to comment
  
  if tonumber(bdrift or 0) >= 3500000 then  -------- line 127 
            rank = "Server Drift King" 
            setElementData(player, "driftrank", rank) 
  
  
    dxDrawText("\n\n\nRank: "..getElementData(player, "driftrank") or "DRIFT\n\nGood Drifter for Beginner!", 20,155,screenWidth,screenHeight, Red, 1.2, "arial","left","top", false,true,false)  ---- line 156 
  
  

Link to comment
  
  if tonumber(bdrift or 0) >= 3500000 then  -------- line 127 
            rank = "Server Drift King" 
            setElementData(player, "driftrank", rank) 
  
  
    dxDrawText("\n\n\nRank: "..getElementData(player, "driftrank") or "DRIFT\n\nGood Drifter for Beginner!", 20,155,screenWidth,screenHeight, Red, 1.2, "arial","left","top", false,true,false)  ---- line 156 
  
  

ok line 127 is fixed now but still same error on 156

Link to comment
  
  
  if tonumber(bdrift or 0) >= 3500000 then  -------- line 127 
            rank = "Server Drift King" 
            setElementData(player, "driftrank", rank) 
  
  
    dxDrawText("\n\n\nRank: "..getElementData(localPlayer, "driftrank") or "DRIFT\n\nGood Drifter for Beginner!", 20,155,screenWidth,screenHeight, Red, 1.2, "arial","left","top", false,true,false)  ---- line 156 
  
  

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...