local teamZombie = createTeam("Zombies")
function onSpawnSlothBot()
local x, y, z = getElementPosition (source)
local rot = 0
local int = getElementInterior(source)
local dim = getElementDimension(source)
local weapon = 0
setTeamFriendlyFire(teamZombie,false)
local skin = math.random(math.floor(21,23)) -- Entre 21 y 23 el skin
for i = 1,10 do
call ( getResourceFromName ( "slothbot" ), "spawnBot", x+i, y+i, z, rot, skin, int, dim, teamZombie, weapon)
end
end
addEvent("onSpawnSlothBot",true)
addEventHandler("onSpawnSlothBot",getRootElement(),onSpawnSlothBot)
function onBotWasted(attacker,weapon,bodypart)
local x,y,z = getElementPosition(attacker)
local rot = 0
local int = getElementInterior(attacker)
local dim = getElementDimension(attacker)
local weapon = 0
local skin = math.random(math.floor(21,23))
call ( getResourceFromName ( "slothbot" ), "spawnBot", x+i, y+i, z, rot, skin, int, dim, teamZombie, weapon)
end
addEvent("onBotWasted",true)
addEventHandler("onBotWasted",getRootElement(),onBotWasted)
I have this . i got some problems. Dont span at random places (span in a line) and still dont respawn