Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 KB | None | 0 0
  1.     for i = 1, #Work.Points do
  2.    
  3.         local x,y,z = POINTS[Work.Points[i]][1], POINTS[Work.Points[i]][2], POINTS[Work.Points[i]][3]
  4.         local tempShape = createColSphere(x,y,z, 25)
  5.         setElementDimension(tempShape, Work.Dim)
  6.         for j = 1, 3 do
  7.        
  8.             local newX, newY = getPointFromDistanceRotation(x,y, 5, 360 * (j/3))
  9.             Work.TentMarkers[#Work.TentMarkers+1] = createMarker(newX, newY, z, "cylinder", 1.2, 0, 0, 255 * (j/3))
  10.             -- problem z get point from dist rotation
  11.             setElementDimension(Work.TentMarkers[#Work.TentMarkers], dim)
  12.             local blip = createBlipAttachedTo(Work.TentMarkers[#Work.TentMarkers], 56)
  13.             setElementParent(blip, Work.TentMarkers[#Work.TentMarkers])
  14.            
  15.            
  16.             setElementData(Work.TentMarkers[#Work.TentMarkers], "arch:tentMarker", tonumber(i))
  17.            
  18.         end
  19.        
  20.         addEventHandler("onClientColShapeHit", tempShape, function(he, md)
  21.                 if getElementType(he) == "player" and he == localPlayer and md then
  22.                
  23.                     local markers = getElementsWithinColShape(source, "marker")
  24.                    
  25.                     if #markers > 0 then
  26.                         for i = 1, #markers do
  27.                            
  28.                             local pos = Vector3(getElementPosition(markers[i]))
  29.                             local newZ = getGroundPosition(pos.x, pos.y, pos.z)
  30.                             if newZ == getGroundPosition(pos.x, pos.y, pos.z+200) then
  31.                                 setElementPosition(markers[i], pos.x, pos.y, newZ)
  32.                             else
  33.                                 setElementPosition(markers[i], pos.x, pos.y, getGroundPosition(pos.x, pos.y, pos.z+200))
  34.                             end
  35.                                
  36.                         end
  37.                     end
  38.                    
  39.                     destroyElement(source)
  40.                 end
  41.             end)
  42.        
  43.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement