Jump to content

[HELP] Table


Recommended Posts

  On 08/05/2019 at 21:45, NX_CI said:

Use the markers ! or Colshape

 

Expand  

You can create for me with colshape ?

  On 09/05/2019 at 03:06, LilDawage said:
getDistanceBetweenPoints3D  use this better and getElementPosition (your Pos ) and getElementPosition (player pos )  player pos >>> getElementByType(player)

 

ds = getDistanceBetweenPoints3D 

if ds < 1 then 

outputChatBox("         ")

 

Expand  

I want table

Link to comment
local positions={
	{fX,fY,fWidth,fHeight}, -- positions
	{fX,fY,fWidth,fHeight}, -- positions
	{fX,fY,fWidth,fHeight}, -- positions
};


local colshape={};

for k, v in ipairs(positions) do
	local x,y,width,height=v[1],v[2],v[3],v[4]
	colshape[#colshape+1]=createColRectangle(x,y,width,height); -- colshape[key] = new col rectangle
end


addEventHandler("onClientColShapeHit",root,
	function(hitElement)
		if hitElement==localPlayer then
			for i=1,#colshape do -- loop for the colshapes table ( i = 1 to count of colshapes )
				if colshape[i]==source then -- check the source colshape if it equals any colshape in the table of colshapes
					-- Your code
				end
			end
		end
	end
);

 

  • Like 1
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...