Jump to content

Como puedo hacer esto?


ELmarcoS.

Recommended Posts

function boss ( ) 
if ( isElement ( slothbot ) ) then 
 destroyElement ( slothbot ) 
end 
  
if ( isElement ( myBlip ) ) then 
 destroyElement ( myBlip ) 
end 
  
slothBot = exports [ "slothBot" ]:spawnBot ( 249.16796875, -1822.9938964844, 3.3400845527649, 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 

Tengo este script que crea un bot en la playa de los santos, pero quiero que aparesca cerca de todos los jugadores, osea que obtenga las coordenadas del jugador y se spawnee cerca de el

Link to comment
function boss ( ) 
if ( isElement ( slothbot ) ) then 
 destroyElement ( slothbot ) 
end 
  
if ( isElement ( myBlip ) ) then 
 destroyElement ( myBlip ) 
end 
  
slothBot = exports [ "slothBot" ]:spawnBot ( getRandomPlayer ( ), 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 

Así?

Link to comment
function boss ( ) 
if ( isElement ( slothbot ) ) then 
 destroyElement ( slothbot ) 
end 
  
if ( isElement ( myBlip ) ) then 
 destroyElement ( myBlip ) 
end 
  
slothBot = exports [ "slothBot" ]:spawnBot ( for index, player in ipairs getElementsByType("players") do  
local x, y, z = getElementPosition(player), 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 

Asi quedaria?

Link to comment
function boss ( ) 
if ( isElement ( slothbot ) ) then 
 destroyElement ( slothbot ) 
end 
  
if ( isElement ( myBlip ) ) then 
 destroyElement ( myBlip ) 
end 
  
getElementPosition ( player ) 
slothBot = exports [ "slothBot" ] 
spawnBot ( x, y, z + 15, 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 

Nose si esta bien ;s

Link to comment
function boss ( ) 
if ( isElement ( slothbot ) ) then 
 destroyElement ( slothbot ) 
end 
  
if ( isElement ( myBlip ) ) then 
 destroyElement ( myBlip ) 
end 
  
slothBot = exports [ "slothBot" ]:spawnBot ( x + 15, y, z, 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 
  
function SpawnOnPlayer() 
  
local randomPlayer = getRandomPlayer () 
local x, y, z = getElementPosition ( randomPlayer ) 
  
end 
addEventHandler ( "onResourceStart", getRootElement(), SpawnOnPlayer ) 

Link to comment
function boss ( ) 
if ( isElement ( slothbot ) ) then 
 destroyElement ( slothbot ) 
end 
  
if ( isElement ( myBlip ) ) then 
 destroyElement ( myBlip ) 
end 
  
slothBot = exports [ "slothBot" ]:spawnBot ( x, y, z, 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 
  
function SpawnOnPlayer() 
  
local randomPlayer = getRandomPlayer () 
local x, y, z = getElementPosition ( randomPlayer ) 
x = x + 15 
  
end 
addEventHandler ( "onResourceStart", getRootElement(), SpawnOnPlayer ) 

Proba.

Link to comment

prova haci

function boss ( ) 
if ( isElement ( slothbot ) ) then 
 destroyElement ( slothbot ) 
end 
  
if ( isElement ( myBlip ) ) then 
 destroyElement ( myBlip ) 
end 
 x,y,z = getElementPosition(source) 
slothBot = exports [ "slothBot" ]:spawnBot ( x + 15, y, z, 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 

haci te tiene que andar

Link to comment
 x,y,z = getElementPosition(source) 
slothBot = exports [ "slothBot" ]:spawnBot ( x + 15, y, z, 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
outputChatBox ( "Zombie Boss has been generated!!, run!", root, 255, 0, 0, true ) 
end 
setTimer ( boss, 300000, 0 ) 
addEventHandler ( "onResourceStart", resourceRoot, boss ) 

WARNING: Loading script failed nemesis/nemesis.lua:5: '' expected near 'end'

._.?

Link to comment
function bot() 
for index, player in ipairs getElementsByType("player") do 
local x, y, z = getElementPosition(player) 
slothBot = exports [ "slothBot" ]:spawnBot ( x, y, z+10, 90, 287, 0, 0, Nemesis, 22, "hunting", true ) 
exports.extra_health:setElementExtraHealth ( slothBot, 1000 ) 
end 
outputChatBox ( "Zombie Bosses have been generated!!, run!", root, 255, 0, 0, true ) 
end 
addCommandHandler("crearbots", bot) 

Prueba el comando /crearbots

Creará un NEMESIS al lado de cada jugador online

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...