Jump to content

[Help]|[Ayuda] I need help please!!!!


elfetoperez

Recommended Posts

Hello you have any idea why it is not destroyed??? | Hola Tienes alguna idea de porque no se destruye??

survivorSystem.lua:1706: Bad argument @ 'getElementPosition' [Expected element at argument 1]

survivorSystem.lua:1707: Bad argument @ 'getDistanceBetweenPoints3D' [Expected vector3 at argument 4, got boolean]

survivorSystem.lua:1710: Bad argument @ 'destroyElement' [Expected element at argument 1]

function boomMine(player) 
  local mine = getElementData(source, "mine") 
  local x,y,z = getElementPosition(source) 
  setTimer(function() 
    local px,py,pz = getElementPosition(player) 
    local mx,my,mz = getElementPosition(mine) 
    if getDistanceBetweenPoints3D(px,py,pz,mx,my,mz)or 0 < 4 then 
    createExplosion(x,y,z,8) 
    destroyElement(player) 
    destroyElement(mine) 
    end 
  end,350,1) 
end 

Thanks for helping!!!! | Gracias por ayudarme!!!

Link to comment

this is not from the mine script you are posting about

survivorSystem.lua:1706: Bad argument @ 'getElementPosition' [Expected element at argument 1]

survivorSystem.lua:1707: Bad argument @ 'getDistanceBetweenPoints3D' [Expected vector3 at argument 4, got boolean]

survivorSystem.lua:1710: Bad argument @ 'destroyElement' [Expected element at argument 1]

the code is correct source = mine and player = player

where's source defined? i think you've to use player in the lines 2-3 instead of source.

From what you posted and im guessing is the reason why the script isn't working is because your "setTimer" checks if the player is near the mine only once.

In line 12 you need to change 1 to 0

0 = always check if the player is near

but... i could be wrong since i dont know what triggers the boomMine

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