• 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!

Script problem

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
Well im trying to make an script that checks if an player is in area.

LUA:
        fromX = 2254,
	fromY = 685,
	fromZ = 7,
 
	toX = 2328,
	toY = 711,
	toZ = 7

kinda like that but what ever i seem to do it wont work.
 
with this function it will check the area.... i dont know what yo uwant to do, an action onUse, StepIn?

Code:
local t, event = {
	from = {x=2254, y=685, z=7},
	to = {x=2328, y=711, z=7}

}, 0
 
local function player(p)
	for x=t.from.x, t.to.x do
		for y=t.from.y, t.to.y do
			for z=t.from.z, t.to.z do
				local v = getTopCreature({x=x, y=y, z=z}).uid
				if isPlayer(v) then
					..............................................................................
			          end
			end
		end
	end
end

in "......................................................." do what you want! heeh

original function by: Cykotitan! <3
 
Last edited:
didnt work they way i wanted it =(

perhaps i didnt make it clear enugh, i want when an player enters an area then x happends :P


like if player a enters
LUA:
 from = {x=2254, y=685, z=7},
	to = {x=2328, y=711, z=7}

then x happends :P
 
Code:
local t, event = {
	from = {x=2254, y=685, z=7},
	to = {x=2328, y=711, z=7}

}, 0
 
function onThink(interval, lastExecution, thinkInterval)
	for x=t.from.x, t.to.x do
		for y=t.from.y, t.to.y do
			for z=t.from.z, t.to.z do
				local v = getTopCreature({x=x, y=y, z=z}).uid
				if isPlayer(v) then
					..............................................................................
			          end
			end
		end
	end
end

I gotta go now, try this, dont tested... but i think it will work!
 

Similar threads

Back
Top