Hello community.
Here is original thread ( just prototype ):
[Only registered and activated users can see links. Click Here To Register...]
With this LUA function you can check your player coordinates.
Add this function to questlib.lua
check_range
Here is use example quest:
Go near to Ah-Yu and Voila!
Enjoy :rolleyes: ..
Here is original thread ( just prototype ):
[Only registered and activated users can see links. Click Here To Register...]
With this LUA function you can check your player coordinates.
Add this function to questlib.lua
Then add this function to your quest_functions file.Quote:
function check_range(x,y,range)
get_x = pc.get_local_x()
get_y = pc.get_local_y()
x1 = x-range
y1 = y-range
x2 = x+range
y3 = y+range
if (get_x > x1 and get_x < x2) and (get_y > y1 and get_y < y3) then
return true
else
return false
end
end
check_range
Here is use example quest:
/go c1Quote:
-- By -TURK- --
quest check_coord begin
state start begin
when login with pc.get_map_index() == 41 begin
loop_timer("check_coords", 1) -- 1 second
end
when check_coords.timer begin
if check_range(377,576,10) == true then
chat("You're near to Ah-Yu!")
-- pc.warp(x,y)
end
end
end
end
Go near to Ah-Yu and Voila!
Enjoy :rolleyes: ..