Jump to content

Bot Problem


Anbu7

Recommended Posts

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

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...