Jump to content

[HELP] Projectiles/rockets


.:HyPeX:.

Recommended Posts

Hello guys, i'm facing a problem, i cannot retrive whenever a projectile (rocket in this case), while colliding explodes, onClientExplosion retrives just the creator of the explosion, this does not involve the projectile itself...

onElementDestroy -- Server side, does not include their self-destruction

i couldnt find any more alternatives, checking onClientRender to loop throught all projectiles -- Projectile is destroyed before...

Thanks in advance.

Link to comment
What exactly are you trying to achieve? You've got me rather confused :P

I just got it, apparently the client side version of the function works pretty well :D

Someone should mention in the wiki that this function includes the destruction of the element by themselves..

  
addEventHandler("onClientElementDestroy", getRootElement(), function () 
if getElementType(source) == "projectile" then 
    if getProjectileType(source) == 19 then 
    if not enabled then return end 
        if Missiles[source] then 
            Missiles[source].missile = nil 
            destroyElement(Missiles[source].marker) 
            Missiles[source].timer = nil 
            Missiles[source] = nil 
        end 
    end 
end 
end) 

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