• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Get position light level

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
544
Solutions
6
Reaction score
121
Location
player:getTown()
Hello it's possible to get light level per selected position on server side?

Including:
  • getWorldLight()
  • floor level
  • item light sources (torch, firefield, etc)
  • creatures light source (player with "utevo lux" spell, etc)
 
We can use some functions (see the links below) to detect lights from torch, players, ambience (firefield example), etc

The start:
Lua:
function onSay(player, words, param)
local command = string.lower(param)
if command == "checktile" then
    local x, y, z = tonumber(words[2]), tonumber(words[3]), tonumber(words[4])
    local tile = Tile(Position(x, y, z))
   
    if not tile then
        player:sendCancelMessage("Invalid tile position.")
        return false
    end
   
    -- Perform tile checking logic here
   
else
    player:sendCancelMessage("Unknown command.")
end

return false

Check here:
 
Back
Top