feat: 50 игр на Lua + импорт Roblox для всех + поддержка Lua в плеере #39
@ -3566,10 +3566,14 @@ local hintVisible = false
|
|||||||
RunService.Heartbeat:Connect(function()
|
RunService.Heartbeat:Connect(function()
|
||||||
if built then return end
|
if built then return end
|
||||||
local px = __rbxl_player_x()
|
local px = __rbxl_player_x()
|
||||||
|
local py = __rbxl_player_y()
|
||||||
local pz = __rbxl_player_z()
|
local pz = __rbxl_player_z()
|
||||||
local dx = part.Position.X - px
|
local dx = part.Position.X - px
|
||||||
|
local dy = part.Position.Y - py
|
||||||
local dz = part.Position.Z - pz
|
local dz = part.Position.Z - pz
|
||||||
local dist = math.sqrt(dx*dx + dz*dz)
|
-- 3D-дистанция — иначе 8 мест-призраков один над другим
|
||||||
|
-- все видят hintVisible=true (по X+Z они в (0,0,0))
|
||||||
|
local dist = math.sqrt(dx*dx + dy*dy + dz*dz)
|
||||||
local near = dist <= 4
|
local near = dist <= 4
|
||||||
if near ~= hintVisible then
|
if near ~= hintVisible then
|
||||||
hintVisible = near
|
hintVisible = near
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user