bamby12 Posted February 3, 2011 Posted February 3, 2011 i know how to get and set element data but how would i go about putting it in a gui??
Castillo Posted February 3, 2011 Posted February 3, 2011 What do you mean? set a element data on a GUI element?
bamby12 Posted February 3, 2011 Author Posted February 3, 2011 I mean I want to show a players experience on the GUI using getElementData but I don't understand how to put it on a GUI.
proracer Posted February 3, 2011 Posted February 3, 2011 If you mean with concatenation than try this.. function experience() GUIEditor_Window = {} GUIEditor_Label = {} -- local experience = getElementData(getLocalPlayer(),"experience") -- replace the name of key with yours GUIEditor_Window[1] = guiCreateWindow(481,178,579,367,"Experience Panel",false) GUIEditor_Label[1] = guiCreateLabel(27,45,125,25,"Experience:" ..experience,false,GUIEditor_Window[1]) -- here' s the concatenation guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) end addEventHandler("onClientResourceStart", getRootElement(), experience) Not sure if this works and I dont know if you mean this.
bamby12 Posted February 3, 2011 Author Posted February 3, 2011 hmm i made this but it dosnt work. if XP == 25 then setElementData ( attacker, "Level:", 2) outputChatBox ( attacker, "You Are Now Level 2!", 0,255,0) end if XP == 75 then setElementData ( attacker, "Level:", 3) outputChatBox ( attacker, "You Are Now Level 3!", 0,255,0) end if XP == 150 then setElementData ( attacker, "Level:", 4) outputChatBox ( attacker, "You Are Now Level 4!", 0,255,0) end if XP == 300 then setElementData ( attacker, "Level:", 5) outputChatBox ( attacker, "You Are Now Level 5!", 0,255,0) end if XP == 425 then setElementData ( attacker, "Level:", 6) outputChatBox ( attacker, "You Are Now Level 6!", 0,255,0) end if XP == 650 then setElementData ( attacker, "Level:", 7) outputChatBox ( attacker, "You Are Now Level 7!", 0,255,0) end
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