Jump to content

I want to make a spawn killed a bot,


Recommended Posts

Posted

I am a complete noob in LUA scripting, and could you tell me what is my mistake in this code? Look at setTimer, I want to make a spawn killed a bot, that would be after he was killed, he appeared again, after a certain time, but I can't figure out what my error is?

local NemesisTeam = createTeam("Nemesis",200,1,1) 
local Nemesis  = getTeamFromName ( "Nemesis" ) 
  
function SpawnBot ( thePlayer)   
local AclNome = getAccountName ( getPlayerAccount ( thePlayer ) )  
     if isObjectInACLGroup ("user."..AclNome, aclGetGroup ( "Admin" ) ) then  
       nemesi = exports [ "slothBot" ]:spawnBot ( -1935.5480957031, 665.44055175781, 47.0, 90,  math.random ( 300, 303 ), 0, 0, Nemesis, 38,         "hunting", true ) 
      setElementModel ( nemesi, 9 ) 
      outputChatBox ("#9E0000Nemesis: #0D9905STARS",getRootElement(), 255, 255, 255, true ) 
      attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) 
      triggerClientEvent ( "nsound", root )     
      setElementData(nemesi, "nemesis",true) 
if nemesi then 
 exports.extra_health:setElementExtraHealth ( nemesi, 100 ) 
         end 
      end 
end 
addCommandHandler("nemo",  SpawnBot)   
  
addEvent("onBotWasted",true) 
addEventHandler("onBotWasted", root, 
    function() 
        setTimer(SpawnBot, 3000, 1, source) 
    end 
)  
  
function SetAdmNemesisTeam(thePlayer) 
local AclNome = getAccountName ( getPlayerAccount ( thePlayer ) )  
     if isObjectInACLGroup ("user."..AclNome, aclGetGroup ( "Admin" ) ) then  
setPlayerTeam ( thePlayer, Nemesis ) 
end 
 end 
addCommandHandler("nemesiTeam",SetAdmNemesisTeam) 

Posted

baz it's not defined in your code.

attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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