• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua If dire, what its mean?

Faraonekkk

New Member
Joined
Feb 15, 2010
Messages
686
Reaction score
4
Can anyone more experienced say me what thats mean?

Code:
		if math.random(1,100) >= 51 then


the script
Code:
local dire = getDirectionTo(getThingPos(getCreatureSummons(cid)[1]), params.topos)
	if dire >= 0 and dire <= 7 then
	if dire == NORTHWEST then
		if math.random(1,100) >= 51 then
		dire = NORTH
			if isWalkable(getPosByDir(getThingPos(getCreatureSummons(params.cid)[1]), dire), params.ccid, 0, 0) then
			dire = NORTH
			else
			dire = WEST
			end

Its in position32
Code:
function getDirectionTo(pos1, pos2)
	local dir = NORTH
	if(pos1.x > pos2.x) then
		dir = WEST
		if(pos1.y > pos2.y) then
			dir = NORTHWEST
		elseif(pos1.y < pos2.y) then
			dir = SOUTHWEST
		end
	elseif(pos1.x < pos2.x) then
		dir = EAST
		if(pos1.y > pos2.y) then
			dir = NORTHEAST
		elseif(pos1.y < pos2.y) then
			dir = SOUTHEAST
		end
	else
		if(pos1.y > pos2.y) then
			dir = NORTH
		elseif(pos1.y < pos2.y) then
			dir = SOUTH
		end
	end
 
Code:
local dire = getDirectionTo(getThingPos(getCreatureSummons(cid)[1]), params.topos)
	if dire >= 0 and dire <= 7 then
	if dire == NORTHWEST then
It is a condicion that asks if player summons are to the north west
 
Back
Top