drk Posted February 24, 2012 Share Posted February 24, 2012 (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 February 24, 2012 by Guest Link to comment
Castillo Posted February 24, 2012 Share Posted February 24, 2012 "teste.lua" will load before "textlib.lua" does. Link to comment
Kenix Posted February 24, 2012 Share Posted February 24, 2012 (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 February 24, 2012 by Guest Link to comment
Kenix Posted February 24, 2012 Share Posted February 24, 2012 "teste.lua" will load before "textlib.lua" does. Just use onClientResourceStart. And you can not think of it. Link to comment
Castillo Posted February 24, 2012 Share Posted February 24, 2012 Thanks Castillo. You're welcome. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now