Function At Coords [Standalone]

This script allow you to create whatever interaction you want in a specific area,
such as place marker when you are close from a specific position or simply check variables.
It allows to launch a script when your player is close to the interaction point.

please read carefully this little code snippet to understand how does this script works

TriggerEvent('position:add',{--[[Interaction properties given with the purschase of the script.]]},function(value)
    -- this function is called when the player is close enough to the point of interaction,
    -- value gives the distance between the player and the interaction point
    --here you can
    -- - drawmarker
    -- - wait interactions
    -- - make safezone
    -- - give informations
    -- you can whatever you want
end)

Youtube - Preview this video shows only a minimum part of this script. It can be pushed up.

not available anymore if you search this script contact me.

Please save yourself the money. If you’re a developer you don’t need this.

local function doStuff() -- Make your function here
    print("In Zone")
end

CreateThread(function()
    while true do 
        Wait(1)
        local inZone = false
        if #(GetEntityCoords(PlayerPedId()) - vector3(1,1,1)) < 200 then -- vector3 is the coords where th "circle" is made, the < 200 is the radius from those coords
            inZone = true -- Set the timeout var
            doStuff() -- Call the above function
        end

        if not inZone then -- If not in zone wait 
            Wait(1000)
        end
    end
end)
3 Likes

This script has the exact interest to not use these lines of code on each of our scripts.

But you are sending events ? Thats worse then just waste couple of minutes and add a function

once triggered the script indexes the event and calculates all the coordinates simultaneously, it is a way to optimize

here’s a free script for that btw

1 Like