Anbu7 Posted September 3, 2014 Share Posted September 3, 2014 Well, I am trying to create a mini mission, the player will fail if the bot gets killed, so the arrival marker should be destroyed but i couldn't destroy it,the blip as well, Thanks addEventHandler ( "onBotWasted", root, function ( attacker ) if (source == botTable[Girl]) then outputChatBox("Mission Failed",attacker,255,0,0) destroyElement(finishMarker) destroyElement(myBlip) end end ) Link to comment
Castillo Posted September 3, 2014 Share Posted September 3, 2014 if (source == botTable[Girl]) then Where is 'Girl' defined? Also, try adding this before addEventHandler: addEvent ( "onBotWasted", true ) Link to comment
Anbu7 Posted September 3, 2014 Author Share Posted September 3, 2014 Here is the script, and i tried to add "addEvent" before, but it didn't work botTable = {} addEvent("Accept",true) addEventHandler("Accept",root, function (hitElement) botTable[Girl] = call ( getResourceFromName ( "slothbot" ), "spawnBot", x,y,z,0,115,Dim,Int,nil,0) call ( getResourceFromName ( "slothbot" ), "setBotFollow",botTable[Girl], hitElement ) setTimer( function () call(getResourceFromName("slothbot"), "setBotAttackEnabled",botTable[Girl],false ) end,60000,0) end ) addEventHandler ( "onBotWasted", root, function ( attacker ) if (source == botTable[Girl]) then outputChatBox("Mission Failed",attacker,255,0,0) destroyElement(finishMarker) destroyElement(myBlip) end end ) Link to comment
Wei Posted September 3, 2014 Share Posted September 3, 2014 botTable = {} addEvent("Accept",true) addEventHandler("Accept",root, function (hitElement) botTable["Girl"] = call ( getResourceFromName ( "slothbot" ), "spawnBot", x,y,z,0,115,Dim,Int,nil,0) call ( getResourceFromName ( "slothbot" ), "setBotFollow",botTable["Girl"], hitElement ) setTimer( function () call(getResourceFromName("slothbot"), "setBotAttackEnabled",botTable["Girl"],false ) end,60000,0) end ) addEvent("onBotWasted",true) addEventHandler ( "onBotWasted", root, function ( attacker ) if (source == botTable["Girl"]) then outputChatBox("Mission Failed",attacker,255,0,0) destroyElement(finishMarker) destroyElement(myBlip) end end) do you have x,y,z,Dim,Int defined ? Link to comment
Anbu7 Posted September 3, 2014 Author Share Posted September 3, 2014 yep everything is defined,the problem ain't on the bot, i just want to destroy the marker and the blip once the bot die 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