mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
feat(imports/points): onEnter method
This commit is contained in:
@@ -32,9 +32,14 @@ CreateThread(function()
|
|||||||
if distance <= point.distance then
|
if distance <= point.distance then
|
||||||
nearby[#nearby + 1] = point
|
nearby[#nearby + 1] = point
|
||||||
point.currentDistance = distance
|
point.currentDistance = distance
|
||||||
|
|
||||||
|
if point.onEnter and not point.inside then
|
||||||
|
point.inside = true
|
||||||
|
point:onEnter()
|
||||||
|
end
|
||||||
elseif point.currentDistance then
|
elseif point.currentDistance then
|
||||||
if point.onExit then point:onExit() end
|
if point.onExit then point:onExit() end
|
||||||
point.entered = nil
|
point.inside = nil
|
||||||
point.currentDistance = nil
|
point.currentDistance = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user