Sasu Posted April 15, 2013 Share Posted April 15, 2013 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? Link to comment
PaiN^ Posted April 15, 2013 Share Posted April 15, 2013 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
TAPL Posted April 15, 2013 Share Posted April 15, 2013 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
Sasu Posted April 15, 2013 Author Share Posted April 15, 2013 (edited) Nothing u.u Edit: TAPL outputChatBox dont have element to visible to. Edited April 15, 2013 by Guest Link to comment
PaiN^ Posted April 15, 2013 Share Posted April 15, 2013 Are you sure of your coordinates ? + Is't server side in the meta.xml ? Link to comment
Sasu Posted April 15, 2013 Author Share Posted April 15, 2013 I'm using the command /showcol so yes and Its type client. Link to comment
PaiN^ Posted April 15, 2013 Share Posted April 15, 2013 onColShapeHit <-- Server Side ... Link to comment
Sasu Posted April 15, 2013 Author Share Posted April 15, 2013 Oh I was thinking that colshape is only client. Thank you very much. Link to comment
PaiN^ Posted April 15, 2013 Share Posted April 15, 2013 You're welcome + Client --> onClientColShapeHit Link to comment
Sasu Posted April 16, 2013 Author Share Posted April 16, 2013 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
OGF Posted April 16, 2013 Share Posted April 16, 2013 Change createProjectile(object, 20, _,_,_, 200, hitElement) to createProjectile(localPlayer, 20, _,_,_, 200, hitElement) Link to comment
Sasu Posted April 16, 2013 Author Share Posted April 16, 2013 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
OGF Posted April 16, 2013 Share Posted April 16, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now