Jump to content

Why player's health not decrease?


zaticsergiu

Recommended Posts

local positions= 
   { 
     { -3511.0622558594, 1745.8352050781, 75.607810974121 }, 
     { -3507.8325195313, 1771.8107910156, 75.607810974121 }, 
     { -3552.9904785156, 1773.0948486328, 75.607810974121 }, 
     { -3555.6606445313, 1742.8951416016, 75.607810974121 }, 
   } 
  
  
function oh(thePlayer) 
  local azar = math.random ( #positions ) 
  setPedArmor ( thePlayer, 0 ) 
  takeAllWeapons (thePlayer) 
  setElementPosition (thePlayer, unpack ( positions [ azar ] ) )   
  setElementHealth (thePlayer, 1) 
   
  end 
  addCommandHandler("oh", oh) 
   
  

player's health not decrease like he has godmode

help

Sorry for my bad english

Link to comment

Does it do the rest like setPedArmor() etc? Because AFAIK math.random only works with numbers, so try math.random(1,4)

Try

local positions= 
   { 
     { -3511.0622558594, 1745.8352050781, 75.607810974121 }, 
     { -3507.8325195313, 1771.8107910156, 75.607810974121 }, 
     { -3552.9904785156, 1773.0948486328, 75.607810974121 }, 
     { -3555.6606445313, 1742.8951416016, 75.607810974121 }, 
   } 
  
  
function oh(thePlayer) 
  local azar = math.random ( 1,4 ) 
  local x,y,z = unpack(positions[azar]) 
  setPedArmor ( thePlayer, 0 ) 
  takeAllWeapons (thePlayer) 
  setElementPosition (thePlayer, x,y,z)   
  setElementHealth (thePlayer, 1) 
  
  end 
  addCommandHandler("oh", oh) 
  
  

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