justn Posted April 18, 2014 Posted April 18, 2014 Hi, i am making a food store, and the problem is , when the player clicks the button, it doesn't set the health addEventHandler("onClientGUIClick",Burger_Window, function(b) if b == "left" then if source == Burger_Kids then takePlayerMoney(2) setElementHealth(getElementHealth(localPlayer)+2) elseif source == Burger_Regular then takePlayerMoney(5) setElementHealth(getElementHealth(localPlayer)+5) elseif source == Burger_Large then takePlayerMoney(8) setElementHealth(getElementHealth(localPlayer)+8) elseif source == Burger_Salad then takePlayerMoney(10) setElementHealth(getElementHealth(localPlayer)+10) elseif source == Burger_Close then guiSetVisible(Burger_Window,false) showCursor(false) end end end) Datastore - Store data to a database quickly. (Useful for saving scripted tables)
Moderators IIYAMA Posted April 18, 2014 Moderators Posted April 18, 2014 setElementHealth(getElementHealth(localPlayer)+2) setElementHealth(localPlayer,getElementHealth(localPlayer)+2) Check debug!!! -_-" It should give the warning element expected at argument 1, but it is giving a number. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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