Jump to content
  • 0

setElementHealth Problem


SuperBrandy

Question

Hey there!

I got stuck on a problem and i really don't know why it appears. I want to create a ped serverside, set it's health to 50 and pass it to a client.

SERVER

function Ped() 
  
local Ped = createPed (skin, x , y , z, 0, true ) 
setElementHealth(Ped , 50) 
outputChatBox("Server Health "..getElementHealth(Ped )) 
triggerClientEvent(client, "PedClient", getRootElement(), Ped ) 
end 
  

CLIENT

  
function PedClient(Ped) 
outputChatBox("Client Health "..getElementHealth(Ped)) 
end 
  
addEvent("PedClient", true) 
addEventHandler("PedClient", getRootElement(), PedClient) 
  

ChatBox:

Client Health: 100

Server Health: 50

!IN THIS ORDER :o

Thanks for every answer!

Link to comment

2 answers to this question

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