Jump to content

getElementHealth problem


justn

Recommended Posts

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) 

Link to comment
  • Moderators

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...