Is there any function for that? For example: I want to check if the light (obj id 1893) is above (or "gives light" to) some other object, let's say a table(obj id 1433).
No I dont think you can but you could try checking if the light is a valid object (IsValidObject) and then do the rest of your code. https://sampwiki.blast.hk/wiki/IsValidObject
And maybe you can try to get the pos of the object and see if its near the other object.