Jump to content

Attempt to arithmetic on local x1 ( a boolean value )


stefutz101

Recommended Posts

local x,y,z = getElementPosition(newbiePosition) 
    local x1,y1,z1 = getScreenFromWorldPosition(x,y,z) 
    local length = dxGetTextWidth(newbieText,1,"default-bold") 
    dxDrawImage ( x1-length/2-screenWidth*0.01,y1, screenWidth*0.101, screenHeight*0.09, "images/lootTable.png",0,0,0,tocolor(255,255,255)) 

I dont see problem , x1 is defined. Any help , please ? :D

Link to comment
  • Moderators

x1 is defined, yet the function getScreenFromWorldPosition can't return correct values, because that position is behind your camera.

Add line between line 2 and 3:

if x1 then 

And of course add an end...

end 

P.s: z1 is nothing.

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