Jump to content

colshape


Sasu

Recommended Posts

local colshape = createColCuboid( 1107.72, -2080.25, 0, 194, 100, 100) 
  
function projectiles(hitElement) 
if source == colshape then 
local data = getElementData(hitElement, "Basejuli") 
if getElementType(hitElement) == "player" and data == "Aceptado" then 
outputChatBox("Bienvenido a la base", 0, 255, 0) 
elseif data == "Rechazado" or nil then 
outputChatBox("Intruso detectado. Lanzando projectiles...", 255, 0, 0) 
end 
end 
end 
addEventHandler("onColShapeHit", root, projectiles) 

Why this dont work and no error on debug? :S

Link to comment
local colshape = createColCuboid( 1107.72, -2080.25, 0, 194, 100, 100) 
  
function projectiles(hitElement) 
    if source == colshape then 
        local data = getElementData(hitElement, "Basejuli") 
        if getElementType(hitElement) == "player" then 
            if data == "Aceptado" then 
                outputChatBox("Bienvenido a la base", 0, 255, 0) 
            elseif data == "Rechazado" or nil then 
                outputChatBox("Intruso detectado. Lanzando projectiles...", 255, 0, 0) 
            end 
        end  
    end 
end 
addEventHandler("onColShapeHit", root, projectiles) 

Link to comment
local colshape = createColCuboid( 1107.72, -2080.25, 0, 194, 100, 100) 
  
function projectiles(hitElement) 
    if source == colshape then 
        if getElementType(hitElement) == "player" then 
            local data = getElementData(hitElement, "Basejuli") 
            if data == "Aceptado" then 
                outputChatBox("Bienvenido a la base", hitElement, 0, 255, 0) 
            elseif data == "Rechazado" or data == nil then 
                outputChatBox("Intruso detectado. Lanzando projectiles...", hitElement, 255, 0, 0) 
            end 
        end 
    end 
end 
addEventHandler("onColShapeHit", root, projectiles) 

Link to comment

Why this dont create a projectile?

function projectiles(hitElement) 
if source == colshape then 
        if getElementType(hitElement) == "player" then 
            local data = getElementData(hitElement, "Basejuli") 
            if data == "Aceptado" then 
                outputChatBox("Bienvenido a la base", 0, 255, 0) 
            else 
                createProjectile(object, 20, _,_,_, 200, hitElement) 
                outputChatBox("Intruso detectado. Lanzando projectiles...", 255, 0, 0) 
            end 
        end 
    end 
end 
addEventHandler("onClientColShapeHit", root, projectiles) 

Link to comment
Change
createProjectile(object, 20, _,_,_, 200, hitElement) 

to

createProjectile(localPlayer, 20, _,_,_, 200, hitElement) 

I want that the object create a projectile.

local object = createObject(3267, 1304.9000244141, -2081.1000976563, 73.599998474121, 0, 0, 47.840698242188) 

Link to comment

Ok, you need to make the localPlayer create that projectile though. So when the person hits it do

createProjectile(localPlayer, 20, 1304.900,-2081.10,73.59, 200, hitElement) 

so it creates it at the objects position.

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