Cocodrilo Posted September 2, 2013 Share Posted September 2, 2013 (edited) Hi everyone, How to make to spawn a bot when i hit a maker? This is my code but even I can't see the marker What is wrong? local coco = createMarker( -5894.84375, 1705.669921875, 190.88436889648, "Cylinder", 3, 143, 7, 49, 255) function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) local account = getPlayerAccount( hitElement ) local zombiekills = getAccountData(account,"Zombie kills") if (zombiekills <= 100000) then local skin = 155 slothbot1 = exports [ "slothbot" ]:spawnBot ( 168.3, 1409.7, 10.6, 90, skin, 0, 0, ex, 38, "hunting", true ) local id = getElementModel ( slothbot1 ) if id == 155 then exports.extra_health:setElementExtraHealth(slothbot1, 1000) outputChatBox("The Boss 1 has spawned !!!", getRootElement(), 255, 0, 0) myBlip = createBlipAttachedTo ( slothbot1, 23 ) end end end addEventHandler( "onMarkerHit", coco, MarkerHit ) Edited September 3, 2013 by Guest Link to comment
WASSIm. Posted September 2, 2013 Share Posted September 2, 2013 local coco = createMarker( -5894.84375, 1705.669921875, 190.88436889648, "cylinder", 3, 143, 7, 49, 255) Link to comment
Cocodrilo Posted September 2, 2013 Author Share Posted September 2, 2013 omg! I am so idiot Thank you Link to comment
Cocodrilo Posted September 3, 2013 Author Share Posted September 3, 2013 Now how to add a setTimer to spawn the bot 10 sec after i hit the marker ? Link to comment
DNL291 Posted September 3, 2013 Share Posted September 3, 2013 local coco = createMarker( -5894.84375, 1705.669921875, 190.88436889648, "Cylinder", 3, 143, 7, 49, 255) function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) local account = getPlayerAccount( hitElement ) local zombiekills = getAccountData(account,"Zombie kills") if (zombiekills <= 100000) then local skin = 155 setTimer( function() slothbot1 = exports [ "slothbot" ]:spawnBot ( 168.3, 1409.7, 10.6, 90, skin, 0, 0, ex, 38, "hunting", true ) local id = getElementModel ( slothbot1 ) if id == 155 then exports.extra_health:setElementExtraHealth(slothbot1, 1000) outputChatBox("The Boss 1 has spawned !!!", getRootElement(), 255, 0, 0) myBlip = createBlipAttachedTo ( slothbot1, 23 ) end end, 10000, 1 ) end end addEventHandler( "onMarkerHit", coco, MarkerHit ) Link to comment
Fabioxps Posted September 3, 2013 Share Posted September 3, 2013 Now how to add a setTimer to spawn the bot 10 sec after i hit the marker ?setTimer(function() slothbot1 = exports [ "slothbot" ]:spawnBot ( 168.3, 1409.7, 10.6, 90, skin, 0, 0, ex, 38, "hunting", true ) end,3000,1) Link to comment
Fabioxps Posted September 3, 2013 Share Posted September 3, 2013 I was more sluggish. Link to comment
Cocodrilo Posted September 3, 2013 Author Share Posted September 3, 2013 thanks to both ! works 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