Jump to content

Attempt to index global 'dxText' ( a nil value )


drk

Recommended Posts

Posted (edited)

I'm trying to use Talidan's textlib but when I start the script ( test script ) I get error attempt to index global 'dxText' ( a nil value ).

Can someone help me?

Client:

local sx, sy = guiGetScreenSize() 
  
image1 = guiCreateStaticImage((236/800)*sx,(486/600)*sy,(366/800)*sx,(73/600)*sy,"images/grid.png",false) 
bar1 = guiCreateStaticImage((763/800)*sx,(5/600)*sy,(34/800)*sx,(37/600)*sy,"images/music.png",false) 
  
music = dxText:create("ASHUHASUASHUASHUASUHASHU",(246/800)*sx,(520/600)*sy,false) 
music:color(255,255,255,255) 
music:scale(0.5) 
music:postGUI(true) 
playing = dxText:create("Now playing:",(313/800)*sx,(490/600)*sy,false) 
playing:color(255,20,147,255) 
playing:scale(0.6) 
playing:postGUI(true) 
  

Meta.xml:

    

Textlib is in the script.

Edited by Guest
Posted (edited)
local sx, sy = guiGetScreenSize() 
  
addEventHandler( 'onClientResourceStart',resourceRoot, 
    function( ) 
        image1 = guiCreateStaticImage((236/800)*sx,(486/600)*sy,(366/800)*sx,(73/600)*sy,"images/grid.png",false) 
        bar1 = guiCreateStaticImage((763/800)*sx,(5/600)*sy,(34/800)*sx,(37/600)*sy,"images/music.png",false) 
          
        music = dxText:create("ASHUHASUASHUASHUASUHASHU",(246/800)*sx,(520/600)*sy,false) 
        music:color(255,255,255,255) 
        music:scale(0.5) 
        music:postGUI(true) 
        playing = dxText:create("Now playing:",(313/800)*sx,(490/600)*sy,false) 
        playing:color(255,20,147,255) 
        playing:scale(0.6) 
        playing:postGUI(true) 
    end 
)    
  

All forgot event onClientResourceStart :/

Edited by Guest
Posted
    

"teste.lua" will load before "textlib.lua" does.

Just use onClientResourceStart.

And you can not think of it.

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