Advertisement
Guest User

mta issue

a guest
Oct 4th, 2014
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- issue:
  2.  
  3. local ped = createPed(1, 0, 0, 0)
  4. if isElement(ped) then
  5.     setElementHealth(ped, 50) -- set its health to 50
  6.     setTimer(
  7.         function (ped)
  8.             outputChatBox(getElementHealth(ped)) -- this will return 100
  9.         end,
  10.     10000, 1, ped)
  11. end
  12.  
  13.  
  14. --temp solution:
  15.  
  16. local ped = createPed(1, 0, 0, 0)
  17. if isElement(ped) then
  18.     setTimer(
  19.         function (ped)
  20.             setElementHealth(ped, 50) -- set its health to 50
  21.         end,
  22.     1000, 1, ped)
  23.  
  24.     setTimer(
  25.         function (ped)
  26.             outputChatBox(getElementHealth(ped)) -- this will return 50
  27.         end,
  28.     10000, 1, ped)
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement