Jump to content

spawning clickedElement


HUNGRY:3

Recommended Posts

hi i'm trying to spawn clickedElement but it doesn't work!

code:

client

function lxad(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) 
local x, y, z = getElementPosition(localPlayer) 
local showing = isCursorShowing () 
if not getElementData(lp,"lxad") == true then 
if (state ~= 'down') then return end 
if showing then 
if  ( getElementType ( clickedElement )  == 'player' ) then 
if getDistanceBetweenPoints3D(x, y, z, worldX, worldY, worldZ)<=5 then 
local playerHealthC = getElementHealth ( clickedElement ) 
if playerHealthC == 0 then 
outputChatBox("You Revived "..getPlayerName(clickedElement).." !",255,0,0) 
triggerServerEvent("ClientSpawnPlayer",clickedElement) 
killTimer(setTimerOnWasted) 
end 
end 
end 
end 
end 
end 
addEventHandler ( 'onClientClick', root,lxad) 

server:

function spawnrevive(clicked) 
local x,y,z = getElementPosition(clicked) 
spawnPlayer(clicked,x,y,z) 
end 
addEvent("ClientSpawnPlayer",true) 
addEventHandler("ClientSpawnPlayer",root,spawnrevive) 

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