На
local prox1 = script.Parent.Parent.Opystit
local prox2 = script.Parent.Parent.Podnat
local door1 = script.Parent.door1
local door2 = script.Parent.door2
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://107161608907403"
sound.Parent = script.Parent
local function handlePlayerInteraction(player)
local character = player.Character
if not character then return end
local toolInHand = character:FindFirstChild("Веревка")
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then return end
if toolInHand then
if math.random(1, 5) ~= 2 then
door1.Transparency = 1
prox1.Enabled = false
door2.Transparency = 0
prox2.Enabled = true
else
humanoid.Health = 0
end
else
humanoid.Health = 0
end
end
prox1.Triggered:Connect(handlePlayerInteraction)
local prox1 = script.Parent.Parent.Opystit
local prox2 = script.Parent.Parent.Podnat
local door1 = script.Parent.door1
local door2 = script.Parent.door2
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://107161608907403"
sound.Parent = script.Parent
prox1.Triggered:Connect(function(player)
local function checkIfPlayerHoldsItem(player)
local toolInHand = player.Character:FindFirstChildWhichIsA('Веревка')
if toolInHand then
local Random = math.random(1,5)
if Random ~= 2 then
door1.Transparency = 1
prox1.Enabled = false
door2.Transparency = 0
prox2.Enabled = true
else
local hum = player.Character:WaitForChild("Humanoid")
hum.Health = 0
end
else
local hum = player.Character:WaitForChild("Humanoid")
hum.Health = 0
end
end
end)
в чем ошибка? просто в output никакой ошибки нету