Jump to content

createExplosion


#Honda-R

Recommended Posts

I'm trying to make an explode onMarkerHit

Dont Work.

local myMarker = createMarker(-3686, 1600.8000488281, 8.39, 'cylinder', 5, 255, 0, 0, 150) -- create myMarker 
  
function fakeBomb(x,y,z,d) 
    if d then --Check the players Dimension 
        if getElementDimension(getLocalPlayer()) == d then 
                        --If the players Dimension is the current dimension 
                        --Then people on other dimensions cant see this explosion 
            createExplosion(x, y, z, 0, true, -1.0, false) 
end 
  
addEventHandler( "onMarkerHit", myMarker, fakeBomb ) 

Link to comment
  • Moderators

try this: (explosion will be created at the marker)

SERVER

local myMarker = createMarker(-3686, 1600.8000488281, 8.39, 'cylinder', 5, 255, 0, 0, 150) -- create myMarker 
  
function fakeBomb(element,d) 
    if d then 
        local x,y,z = getElementPosition(source) -- source = marker 
        createExplosion(x, y, z, 0) 
    end 
end 
  
addEventHandler( "onMarkerHit", myMarker, fakeBomb ) 
  
  
  

OR

client

  
-- for client side: "onClientMarkerHit" 
local myMarker = createMarker(-3686, 1600.8000488281, 8.39, 'cylinder', 5, 255, 0, 0, 150) -- create myMarker 
  
function fakeBomb(element,d) 
    if d then 
        local x,y,z = getElementPosition(source) -- source = marker 
        createExplosion(x, y, z, 0, true, -1.0, false) 
    end 
end 
  
addEventHandler( "onClientMarkerHit", myMarker, fakeBomb ) 

Link to comment
client 
LINE NUMBER ON/OFF | EXPAND/CONTRACT | SELECT ALL 
  
-- for client side: "onClientMarkerHit" 
local myMarker = createMarker(-3686, 1600.8000488281, 8.39, 'cylinder', 5, 255, 0, 0, 150) -- create myMarker 
  
function fakeBomb(element,d) 
    if d then 
        local x,y,z = getElementPosition(source) -- source = marker 
        createExplosion(x, y, z, 0, true, -1.0, false) 
    end 
end 
  
addEventHandler( "onClientMarkerHit", myMarker, fakeBomb ) 

Worked Perfect! Thanks.

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