Jump to content

Que esta mal en esto?


Plate

Recommended Posts

Hola tengo un problema con este script es que me dice attempt to perform arithmetic on local z (a nil valvue)

function hunter(player) 
local x, y, z = getElementPosition(player) 
hunter = createVehicle ( 425, x, y, z + 1) 
moveObject(hunter, 300, x, y, z + 30) 
setTimer ( destroyElement, 1500, 1, hunter ) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),hunter) 
  

Link to comment
function hunter() 
local x, y, z = getElementPosition(source) 
hunter = createVehicle ( 425, x, y, z + 1) 
moveObject(hunter, 300, x, y, z + 30) --Object = Objeto ~ Elemento. En conclusion, no se movera 
setTimer ( destroyElement, 1500, 1, hunter ) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),hunter) 

Link to comment
function hunter() 
local x, y, z = getElementPosition(source) 
local x2, y2, z2 = getElementPosition(hunter) 
setElementAlpha(cosa, 0) 
cosa = createObject(1000, x2, y2, z2) 
attachtElements(cosa, hunter, 0, 0, 2) 
hunter = createVehicle ( 425, x, y, z + 1) 
moveObject(cosa, 2, x, y, z + 30) -- lo podes corregir esto para que se mueva lento por que nose como se hace  
setTimer ( destroyElement, 1500, 1, hunter ) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),hunter) 

Link to comment
function hunter() 
local x, y, z = getElementPosition(source) 
local x2, y2, z2 = getElementPosition(hunter) 
setElementAlpha(cosa, 0) 
cosa = createObject(1000, x2, y2, z2) 
attachtElements(cosa, hunter, 0, 0, 2) 
hunter = createVehicle ( 425, x, y, z + 1) 
moveObject(cosa, 2, x, y, z + 30) -- lo podes corregir esto para que se mueva lento por que nose como se hace  
setTimer ( destroyElement, 1500, 1, hunter ) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),hunter) 

function hunter() 
cosa = createObject(1000, x2, y2, z2) --Lo habias creado despues de usarlo 
hunter = createVehicle ( 425, x, y, z + 1)  --Lo habias creado despues de usarlo 
local x, y, z = getElementPosition(source) 
local x2, y2, z2 = getElementPosition(hunter) 
setElementAlpha(cosa, 0) 
attachElements(cosa, hunter, 0, 0, 2) -- Usaste una "T" de mas 
moveObject(cosa, 20000, x, y, z + 30) -- Deberia moverse en 2 segundos 
setTimer ( destroyElement, 20001, 1, hunter ) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),hunter) 

Link to comment
  
function hunter() 
local sx, sy, sz = getElementPosition(source) 
hunter = createVehicle ( 425, sx, sy, sz + 1)   
local x2, y2, z2 = getElementPosition(hunter) 
cosa = createObject(1000, x2, y2, z2)  
setElementAlpha(cosa, 0) 
attachElements(cosa, hunter, 0, 0, 2)  
moveObject(cosa, 20000, x, y, z + 30)  
setTimer ( destroyElement, 20001, 1, hunter ) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),hunter) 

Link to comment
function hunter() 
local sx,sy,sz = getElementPosition(source) 
hunter = createVehicle ( 425, sx, sy, sz + 1)   
local x2,y2,z2 = getElementPosition(hunter) 
cosa = createObject(1000, x2, y2, z2)  
setElementAlpha(cosa, 0) 
attachElements(cosa, hunter, 0, 0, 2)  
moveObject(cosa, 20000, sx, sy, sz + 30)  
setTimer ( destroyElement, 20001, 1, hunter ) 
end 
addEventHandler("onPlayerSpawn",getRootElement(),hunter) 

Proba asi

Link to comment

El elemento es 'cosa' u.u

hunter = createVehicle ( 425, x, y, z )  
local x,y,z = getElementPosition( hunter )  --para obtener la posicion del hunter 
setTimer ( destroyElement, 3000, 1, hunter ) 
  

probalo asi.

Edited by Guest
Link to comment
  • Recently Browsing   0 members

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