Jump to content

WTF with this attachment...


12p

Recommended Posts

I'm making a new gamemode, as you saw in Resources forum. I use attachments to create colshapes to kill player ;)

But WTF there is a strange thing. When I use vertical direction (rotation in Y 90º), then the colshape gets some kind of problem... I can't touch it! What is this error?

My simple (client) code:

local objects = getElementsByType("object") 
  
for i,object in ipairs (objects) do 
 if getElementModel(object) == 2978 then 
  local shape = createColCuboid (0,0,0,1.6, 0, 1.15) 
  attachElements (shape,object,-0.8,0) 
  addEventHandler ("onClientColShapeHit",shape, 
  function (ele,dim) 
   if ele == getLocalPlayer() then 
    local x,y,z = getElementPosition(ele) 
    fxAddBlood (x-0.5,y,z,0,0,0,500) 
    fxAddBlood (x-0.5,y,z-0.5,0,0,0,500) 
    fxAddBlood (x-0.5,y,z-0.25,0,0,0,500) 
    setElementHealth (ele,0) 
   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...