1
0
Fork 0
cc-stuff/augment/modules/wh.lua

34 lines
1.3 KiB
Lua
Raw Normal View History

return function()
2023-10-12 21:25:20 +03:00
local cache = {}
while _G._running do
2023-10-12 21:36:32 +03:00
for id, entry in pairs(cache) do
if nearbyEntitiesByUUID[id] == nil then
entry.cube.remove()
entry.frame.remove()
2023-10-12 21:37:31 +03:00
cache[id] = nil
end
end
2023-10-12 21:25:20 +03:00
2023-10-12 21:36:32 +03:00
for id, entity in pairs(nearbyEntitiesByUUID) do
if id ~= player.id then
if cache[id] == nil then
cache[id] = {}
cache[id].cube = canvas3d.addBox(0, 0, 0)
2023-10-12 21:48:08 +03:00
cache[id].cube.setSize(0.5, 0.5, 0.5)
2023-10-12 21:36:32 +03:00
cache[id].frame = canvas3d.addFrame({ 0, 0, 0 })
cache[id].text = cache[id].frame.addText({ 0, 0 }, "")
end
cache[id].cube.setAlpha(0x20)
2023-10-12 21:36:32 +03:00
cache[id].cube.setDepthTested(false)
cache[id].frame.setDepthTested(false)
cache[id].cube.setPosition(entity.x - 0.25, entity.y - 0.25, entity.z - 0.25)
2023-10-12 21:36:32 +03:00
cache[id].frame.setPosition(entity.x, entity.y, entity.z)
cache[id].text.setAlpha(0xFF)
2023-10-12 21:59:29 +03:00
cache[id].text.setText(entity.name .. "\n" .. textutils.serialize(entity))
2023-10-12 21:36:32 +03:00
cache[id].text.setColor(0xFF0000FF)
end
end
os.sleep(0.05)
end
end