Jump to content

Small Problem


justn

Recommended Posts

Hi,

I'm currently working on a vehicle shop, and I have just a small problem with getting the player money.

ERROR: VehicleShop\client.lua:66: attempt to compare nil with number

Line 66 in this code would be line 15

addEventHandler("onClientGUIClick",BuyCar_Window, 
function(b) 
    if b == "left" then 
        if source == BuyCar_Close then 
            guiSetVisible(BuyCar_Window,false) 
            showCursor(false) 
        elseif source == BuyCar_Test then 
            local GuiGetTestText = guiGridListGetItemText(BuyCar_Grid,guiGridListGetSelectedItem(BuyCar_Grid),BuyCar_VehName) 
            if ( GuiGetTestText ) then 
            end 
        elseif source == BuyCar_Buy then 
            local GuiGetBuyText = guiGridListGetItemText(BuyCar_Grid,guiGridListGetSelectedItem(BuyCar_Grid),BuyCar_VehName) 
            local GuiGetBuyText1 = guiGridListGetItemText(BuyCar_Grid,guiGridListGetSelectedItem(BuyCar_Grid),BuyCar_VehPrice) 
           if ( GuiGetBuyText ) then 
           if getPlayerMoney() >= tonumber(GuiGetBuyText1) then 
           else 
            exports["TopBarChat"]:sendClientMessage("#FF0000* #00ff00You do not have enough money for this vehicle",255,255,255,true) 
            end 
          end 
        end 
    end 
end)   

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