Jump to content

Killing Ped


Xeno

Recommended Posts

How would I make it so if a ped walks into a colShape, it kills him?

NPC = createPed( ect ect ect... 

function greenzoneEnter ( thePlayer, matchingDimension ) 
if getElementType( thePlayer ) ~= "player" then return end 
outputChatBox ( "* You Entered The Safezone!", thePlayer, 50, 252, 3 ) 
else 
killPed(hitPlayer) 
  
end 
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter ) 

I know how to make it so only certain skins can get in, but I want it so ALL players can get in.

Thanks,

Xeno

Link to comment
function greenzoneEnter ( element, matchingDimension ) 
    local t = getElementType( element ) 
    if t == "player" then 
        outputChatBox ( "* You Entered The Safezone!", element, 50, 252, 3 ) 
    elseif t == "ped" then 
        killPed ( element ) 
    end 
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter ) 

Link to comment
function greenzoneEnter ( element, matchingDimension ) 
    local t = getElementType( element ) 
    if t == "player" then 
        outputChatBox ( "* You Entered The Safezone!", element, 50, 252, 3 ) 
    elseif t == "ped" then 
        killPed ( element ) 
    end 
addEventHandler ( "onColShapeHit", greenzone, greenzoneEnter ) 

It worked perfectly, 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...