Jump to content

help


Recommended Posts

addEventHandler("onClientGUIClick",heal, 
function () 
health = getElementHealth(source) 
walo=getPlayerMoney(player) 
if (walo<=3000) and (health<=100) then 
outputChatBox("you Don't have enough money",200,0,0) 
return 
end 
if (health>=100) and (walo>=3000) then 
 outputChatBox("your health is already full",30,200,0) 
return  
end 
if (walo>=3000) and (health<=100) then 
setElementHealth(root,20) 
takePlayerMoney(3000) 
outputChatBox("you have bought medicine",20,30,200) 
end 
end) 
  
  

attempt to compare number with boolean

healp

(walo means money)

Link to comment
onClientGUIClick - Source:

The source of this event is the GUI element that was clicked.

player is undefined.

Both health and walo are false, so you're compairing numbers with false.

addEventHandler("onClientGUIClick",heal, 
function () 
health = getElementHealth() 
walo=getPlayerMoney() 
if (walo<=3000) and (health<=100) then 
outputChatBox("you Don't have enough money",200,0,0) 
return 
end 
if (health>=100) and (walo>=3000) then 
 outputChatBox("your health is already full",30,200,0) 
return 
end 
if (walo>=3000) and (health<=100) then 
setElementHealth(root,20) 
takePlayerMoney(3000) 
outputChatBox("you have bought medicine",20,30,200) 
end 
end) 
  
  

??

Link to comment
addEventHandler("onClientGUIClick",heal, 
function () 
        health = getElementHealth(localPlayer) 
        walo=getPlayerMoney(localPlayer) 
        if (walo<3000) and (health<=100) then 
                 outputChatBox("you Don't have enough money",200,0,0) 
        elseif (health>=100) and (walo>=3000) then 
                 outputChatBox("your health is already full",30,200,0) 
        elseif (walo>=3000) and (health<=100) then 
                 setElementHealth(localPlayer,20) 
                 takePlayerMoney(3000) 
                 outputChatBox("you have bought medicine",20,30,200) 
         end 
end) 

https://wiki.multitheftauto.com/wiki/GetLocalPlayer

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...