Advertisement
Noneatme

Untitled

Jun 9th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local pflanzen = {}
  2.  
  3. -- Beim Erstellen --
  4.  
  5.  
  6. function createPflanze()
  7.     local objekt = createObject(...)                -- Die Pflanze
  8.     local col = createColRectangle(x, y, 3, 3)      -- Die Colshape
  9.  
  10.     attachElements(col, objekt)                     -- Colshape an Objekt attachen
  11.  
  12.     pflanzen[col] = objekt                          -- Verbinde Colshape mit dem Objekt
  13.  
  14.     addEventHandler("onClientColShapeHit", col, function(thePlayer)
  15.         if(thePlayer == localPlayer) then
  16.             destroyElement(pflanzen[source])        -- Zerstoert die Pflanze des Colshapes
  17.             destroyElement(source)                  -- Zerstoert die Colshape
  18.         end
  19.     end)
  20.  
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement