Ahmed Ly Posted February 13, 2017 Posted February 13, 2017 addEvent("createMarker:Health",true) addEventHandler("createMarker:Health",root, function () x,y,z = getElementPosition(source) i = getElementInterior(source) team = getTeamName(getPlayerTeam(source)) marker = createMarker(x,y,z,"cylinder",1.5,255,255,255,255) setElementInterior(marker,i) outputChatBox("[Server-Dragon] Player "..getPlayerName(source).." Has Been Create Marker at ("..math.floor(x)..","..math.floor(y)..","..math.floor(z)..").",root,0,255,0,true) setTimer(destroyElement,30000,1,marker) end ) addEventHandler("onMarkerHit",resourceRoot, function (hitPlayer,_) if hitPlayer == source and getPlayerTeam(hitPlayer) and getTeamName(getPlayerTeam) == team then if isElementWithinMarker(hitPlayer,marker) then setElementHealth(hitPlayer,30) end end end )
Ahmed Ly Posted February 13, 2017 Author Posted February 13, 2017 53 minutes ago, marty000123 said: What's the problem here? player Don't Got Health From Marker
Mr.Loki Posted February 13, 2017 Posted February 13, 2017 (edited) You need to add the new value to the current value to increase the player's health setElementHealth(hitPlayer,getElementHealth(hitPlayer)+30) Edited February 13, 2017 by loki2143
' A F . Posted February 13, 2017 Posted February 13, 2017 (edited) delete this Edited February 13, 2017 by Default
#kAsR Posted February 13, 2017 Posted February 13, 2017 addEvent("createMarker:Health",true) addEventHandler("createMarker:Health",root, function ( ) if ( isElement ( marker ) ) then destroyElement ( marker ) end local Values = { name = getPlayerName ( source ) , pos = { getElementPosition ( source ) } , int = getElementInterior ( source ) }; marker = createMarker ( Values["pos"][1] , Values["pos"][2] , Values["pos"][3] , "cylinder" , 1.5 , 255,255,255,255 ); setElementInterior ( marker , Values["int"] ); setElementData ( marker , "Team_" , ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) or false ) ); outputChatBox("[Server-Dragon] Player "..tostring(Values["name"]).." Has Been Create Marker at ("..math.floor(Values["pos"][1])..","..math.floor(Values["pos"][2])..","..math.floor(Values["pos"][3])..").",root,0,255,0,true) setTimer( function ( ) setElementData ( marker , "Team_" , nil ) destroyElement ( marker ) end,30000,1) end ); addEventHandler ( "onMarkerHit" , resourceRoot , function ( hitElement ) if ( source == marker and getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) and getTeamName ( getPlayerTeam ( hitElement ) ) == getElementData(source,"Team_") ) then if ( isElementWithinMarker ( hitElement , source ) ) then setElementHealth ( hitElement , getElementHealth ( hitElement ) + 30 ); end end end ); try this
Ahmed Ly Posted February 14, 2017 Author Posted February 14, 2017 13 hours ago, TF8DNA said: addEvent("createMarker:Health",true) addEventHandler("createMarker:Health",root, function ( ) if ( isElement ( marker ) ) then destroyElement ( marker ) end local Values = { name = getPlayerName ( source ) , pos = { getElementPosition ( source ) } , int = getElementInterior ( source ) }; marker = createMarker ( Values["pos"][1] , Values["pos"][2] , Values["pos"][3] , "cylinder" , 1.5 , 255,255,255,255 ); setElementInterior ( marker , Values["int"] ); setElementData ( marker , "Team_" , ( getPlayerTeam ( source ) and getTeamName ( getPlayerTeam ( source ) ) or false ) ); outputChatBox("[Server-Dragon] Player "..tostring(Values["name"]).." Has Been Create Marker at ("..math.floor(Values["pos"][1])..","..math.floor(Values["pos"][2])..","..math.floor(Values["pos"][3])..").",root,0,255,0,true) setTimer( function ( ) setElementData ( marker , "Team_" , nil ) destroyElement ( marker ) end,30000,1) end ); addEventHandler ( "onMarkerHit" , resourceRoot , function ( hitElement ) if ( source == marker and getElementType ( hitElement ) == "player" and getPlayerTeam ( hitElement ) and getTeamName ( getPlayerTeam ( hitElement ) ) == getElementData(source,"Team_") ) then if ( isElementWithinMarker ( hitElement , source ) ) then setElementHealth ( hitElement , getElementHealth ( hitElement ) + 30 ); end end end ); try this not work
Tekken Posted February 14, 2017 Posted February 14, 2017 Try this: addEvent("createMarker:Health", true); addEventHandler("createMarker:Health", root, function() local x,y,z = getElementPosition(source); local i = getElementInterior(source); team = getTeamName(getPlayerTeam(source)); marker = createMarker(x, y, z, "cylinder", 1.5, 255, 255, 255, 255); setElementInterior(marker, i); outputChatBox("[Server-Dragon] Player "..getPlayerName(source).." Has Been Create Marker at ("..math.floor(x)..","..math.floor(y)..","..math.floor(z)..").", root, 0, 255, 0, true); setTimer(destroyElement, 30000, 1, marker); end); addEventHandler("onMarkerHit", marker, function(hitPlayer, _) if getElementType(hitPlayer) == "player" and getTeamName(getPlayerTeam(hitPlayer)) == team then if isElementWithinMarker(hitPlayer, marker) then setElementHealth(hitPlayer, getElementHealth(hitPlayer)+30); end end end);
xeon17 Posted February 14, 2017 Posted February 14, 2017 Enjoy addEvent("createMarker:Health", true); addEventHandler("createMarker:Health", root, function() if (source == client) then local x,y,z = getElementPosition(client) local marker = createMarker(x, y, z, "cylinder", 1.5, 255, 255, 255, 255) setElementInterior(marker, getElementInterior(client)) outputChatBox("[Server-Dragon] Player "..getPlayerName(client).." Has Been Create Marker at ("..math.floor(x)..","..math.floor(y)..","..math.floor(z)..").", root, 0, 255, 0, true); if (getPlayerTeam(client)) then setElementData(marker, "team", getTeamName(getPlayerTeam(client)), false) end setTimer(function() if (isElement(marker)) then destroyElement(marker) end end, 30000, 1) onTeamMarkerHit = function (hitElement, matchingDimensions) if (getElementType(hitElement) == "player") and (matchingDimensions) then if (getPlayerTeam(hitElement)) then local team = getPlayerTeam(hitElement) if (getElementData(source, "team") == getTeamName(team)) then setElementHealth(hitPlayer, getElementHealth(hitPlayer)+30); end end end end addEventHandler("onMarkerHit", marker, onTeamMarkerHit) end end)
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