Jump to content

Bot doesn't receives the weapon.


Recommended Posts

What might be the problem?

client:

  
addCommandHandler("givewep", 
function(command, botid, weapon) 
  
    botid = botid or 1 
    weapon = weapon or "Knife" 
    bot = botGet(botid) or outputChatBox("Invalid Bot.") 
    local weaponid = getWeaponIDFromName(weapon) or outputChatBox("Invalid Weapon.") 
  
    if(bot and weapon) then 
     
        triggerServerEvent("eGiveBotWeapon", localPlayer, bot, weaponid) 
        outputChatBox("Bot " .. tostring(id) .. " given weapon " .. weapon) 
         
    end 
  
end) 
  

server:

  
function giveBotWeapon(bot, weaponID) 
  
    setTimer(giveWeapon, 300, 1, bot, weaponID, 1, true) 
  
end 
addEvent("eGiveBotWeapon", true) 
addEventHandler("eGiveBotWeapon", root, giveBotWeapon) 
  

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