HUNGRY:3 Posted September 11, 2015 Share Posted September 11, 2015 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
TAPL Posted September 11, 2015 Share Posted September 11, 2015 function spawnrevive() local x,y,z = getElementPosition(source) spawnPlayer(source,x,y,z) end addEvent("ClientSpawnPlayer",true) addEventHandler("ClientSpawnPlayer",root,spawnrevive) Link to comment
HUNGRY:3 Posted September 11, 2015 Author Share Posted September 11, 2015 function spawnrevive() local x,y,z = getElementPosition(source) spawnPlayer(source,x,y,z) end addEvent("ClientSpawnPlayer",true) addEventHandler("ClientSpawnPlayer",root,spawnrevive) thanks Link to comment
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 accountSign in
Already have an account? Sign in here.
Sign In Now