Hi.What I want to do is a bit more complicated but to show you what I need help with I will use a simple example.
Iwant to create a few objects around the town for example doors.I want a command that will loops through all the doors and only the doors and set an ID for each one of them.then tell me if I am close to any of them and the ID of that door.(I am asking for an ID because I want to setCameraMatrix(doorx,doory,doorz,playerx,playery,playerz,) if you know an easier way tell me please.
function IsNearDoor(player)
local x,y,z = getElementPosition(getLocalPlayer ( ))
local doorx,doory,doorz = "Idk what to do here"
local distance = getDistanceBetweenPoints3D(x,y,z,doorx,doory,doorz)
if distance < 5 then
outputChatBox ("There is a door near you!")
setCameraMatrix("The coords of that door",x,y,z)
end
end
Thank you in advance