17 lines
881 B
Lua
17 lines
881 B
Lua
-- (Server) посадить игрока на скамейку LobbyBench_1 и проверить, что он сидит лицом к фонтану (спиной к спинке)
|
|
local p = game.Players:GetPlayers()[1]
|
|
local bench = workspace.FishingMap.LobbyFix3:FindFirstChild("LobbyBench_1")
|
|
local seat = bench and bench:FindFirstChildWhichIsA("Seat")
|
|
if not seat then
|
|
return "нет сиденья"
|
|
end
|
|
local hum = p.Character:FindFirstChildOfClass("Humanoid")
|
|
p.Character:PivotTo(seat.CFrame + Vector3.new(0, 3, 0))
|
|
task.wait(0.3)
|
|
seat:Sit(hum)
|
|
task.wait(1)
|
|
local root = p.Character.HumanoidRootPart
|
|
local toCenter = (Vector3.zero - root.Position) * Vector3.new(1, 0, 1)
|
|
local facing = root.CFrame.LookVector:Dot(toCenter.Unit)
|
|
return ("сидит: %s, лицом к фонтану: %.2f (1 = прямо к фонтану)"):format(tostring(seat.Occupant == hum), facing)
|