manve1 Posted August 18, 2012 Share Posted August 18, 2012 hey guys, im trying to make a script.. and when i click on Button ( image ) it does nothing... here is LUA CLIENT: gui = guiCreateStaticImage(0,0,1,1,"images/gui.png", true) showCursor(true) army = guiCreateStaticImage( 20, 20, 100, 70, "images/army.png", false, gui ) function army() if (source == army) then setElementModel(getLocalPlayer(), 287) guiSetVisible(gui, false) showCursor(false) end end addEventHandler("onClientGUIClick", getRootElement(), army) i have no Server side cuz for this script i dont need it... i tihnk that.. PLEASE HELP ME, Thank you. Link to comment
Flaker Posted August 18, 2012 Share Posted August 18, 2012 Try this: local Gui = {} Gui["gui_image"] = guiCreateStaticImage(0,0,1,1,"images/gui.png", true) guiSetVisible(Gui["gui_image"], true) Gui["army_image"] = guiCreateStaticImage( 20, 20, 100, 70, "images/army.png", false, Gui["gui_image"] ) guiSetVisible(Gui["army_image"], true) showCursor(true) function OnArmyClick() if ( source == Gui["army_image"] ) then setElementModel(localPlayer, 287) guiSetVisible(Gui["gui_image"], false) showCursor(false) end end addEventHandler("onClientGUIClick", root, OnArmyClick) Link to comment
Castillo Posted August 18, 2012 Share Posted August 18, 2012 gui = guiCreateStaticImage(0,0,1,1,"images/gui.png", true) showCursor(true) army = guiCreateStaticImage( 20, 20, 100, 70, "images/army.png", false, gui ) function army_() if (source == army) then setElementModel(getLocalPlayer(), 287) guiSetVisible(gui, false) showCursor(false) end end addEventHandler("onClientGUIClick", getRootElement(), army_) Try that, never call a function like a variable/table. Link to comment
manve1 Posted August 18, 2012 Author Share Posted August 18, 2012 (edited) thats not the whole script.... it has got other pictures too... but this dont work.. and never others for same problem.. and idk what the problem is.. EDIT: Thanx solidsnake, it worked, other one didnt.. Edited August 18, 2012 by Guest 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