PartyMTA Posted June 9, 2014 Share Posted June 9, 2014 Can someone help me please? function images() if button1 = guiCreateStaticImage(sX/4-50,sY/1.5,512/2.5,512/2.5,userpanel.image.mapshop,false) and button2 = guiCreateStaticImage(sX/2.3-50,sY/1.5,512/2.5,512/2.5,userpanel.image.settings,false) and button3 = guiCreateStaticImage(sX/1.6-50,sY/1.5,512/2.5,512/2.5,userpanel.image.music,false) then else destroyElement(button1) destroyElement(button2) destroyElement(button3) end end bindKey("U","down",images) debugscript 3 ERROR: Loading script failed: Win8_Userpanel\interface.lua:48: 'then' expected near '=' line 48 = button1 = guiCreateStaticImage(sX/4-50,sY/1.5,512/2.5,512/2.5,userpanel.image.mapshop,false) Link to comment
tosfera Posted June 9, 2014 Share Posted June 9, 2014 It is talking about the if statement, you are creating 3 buttons. If that succeeds you're doing nothing, else you destroy them. would be easier to see if button1 is already an element or not. And decide your creation / deletion on that. Just use isElement 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