Narutimmy Posted July 21, 2015 Posted July 21, 2015 Hola e_e vengo de nuez... quiero hacer un script que cuando muer se cree un customblip ahi todo bien.... pero quiero que al pasar nose 30segs se elimine mi blip.... la idea es que cada jugador al morir se cree uno.. y asi addEventHandler( "onClientPlayerWasted", root, function () local x,y,z = getElementPosition (localPlayer) Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath.png" ) setTimer ( exports.customblips:destroyCustomBlip(Death), 30000, 1) end) EDIT: addEventHandler( "onClientPlayerWasted", root, function () local x,y,z = getElementPosition (localPlayer) Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath.png" ) setTimer ( function (Death) exports.customblips:destroyCustomBlip(Death) end, 30000, 1) end) lo tengo asi pero me da error
Calculador Posted July 22, 2015 Posted July 22, 2015 addEventHandler( "onClientPlayerWasted", root, function () local x,y,z = getElementPosition (localPlayer) Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) setTimer ( function () exports.customblips:destroyCustomBlip(Death) end, 30000, 1) end)
Narutimmy Posted July 22, 2015 Author Posted July 22, 2015 (edited) addEventHandler( "onClientPlayerWasted", root, function () local x,y,z = getElementPosition (localPlayer) Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) setTimer ( function () exports.customblips:destroyCustomBlip(Death) end, 30000, 1) end) Ya se elimina pero solo el primero local counterddd = 0 local Death = {} local TiempoPr1 = 0 addEventHandler( "onClientPlayerWasted", root, function () if ( getTickCount ( ) - TiempoPr1 >= 5000 ) then counterddd = counterddd + 1 local x,y,z = getElementPosition (localPlayer) Death[counterddd] = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath2.png" ) TiempoPr1 = getTickCount ( ) setTimer ( function () if Death[counterddd] then exports.customblips:destroyCustomBlip(Death[counterddd]) end end, 60000*5, 1) end end) La idea es que alse cree uno y a los 30 seg que se creo ese se elimine ese mismo.. pero si se crea otro pase lo mismo mas no se borren los 2 a la vez. Edited July 22, 2015 by Guest
AlFA# Posted July 22, 2015 Posted July 22, 2015 addEventHandler( "onClientPlayerWasted", root, function () local x,y,z = getElementPosition (localPlayer) Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) setTimer ( function () exports.customblips:destroyCustomBlip(Death) end, 30000, 0) end)
Enargy, Posted July 22, 2015 Posted July 22, 2015 addEventHandler( "onClientPlayerWasted", root, function () local x,y,z = getElementPosition (localPlayer) Death = exports.customblips:createCustomBlip ( x,y, 10, 10, "img.png" ) setTimer ( function () exports.customblips:destroyCustomBlip(Death) end, 30000, 0) end) En timer seria 1 y no 0 por que puede que el blip se destruya pero el tiempo se repetira y regresara false.
Narutimmy Posted July 23, 2015 Author Posted July 23, 2015 y como ago funvcionar esto e_e? local counterddd = 0 local Death = {} local TiempoPr1 = 0 addEventHandler( "onClientPlayerWasted", root, function () if ( getTickCount ( ) - TiempoPr1 >= 5000 ) then counterddd = counterddd + 1 local x,y,z = getElementPosition (localPlayer) Death[counterddd] = exports.customblips:createCustomBlip ( x,y, 10, 10, "suddenDeath2.png" ) TiempoPr1 = getTickCount ( ) setTimer ( function () if Death[counterddd] then exports.customblips:destroyCustomBlip(Death[counterddd]) end end, 60000*5, 1) end end) solo se elimina 1...
Enargy, Posted July 23, 2015 Posted July 23, 2015 No tested. dataBlip = {} blips = {} tick = {} addEventHandler("onClientPlayerWasted", root, function() local x,y,z = getElementPosition(localPlayer) table.insert( dataBlip, {x,y} ) for index, value in pairs(dataBlip) do blips[index] = exports.customblips:createCustomBlip ( value[1], value[2], 10, 10, "suddenDeath2.png" ) tick[index] = setTimer( function() exports.customblips:destroyCustomBlip(blips[index]) table.remove( dataBlip, 1 ) end, 30000, 1 ) end end)
Recommended Posts