local object = script.Parent
local function touched(hit)
local character = hit.Parent
if character then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid:TakeDamage(humanoid.MaxHealth)
end
end
end
object.Touched:Connect(touched)
local object = script.Parent
local prig = 2 -- любая цифра
local function touched(hit)
local character = hit.Parent
if character then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
if prig == 0 then -- если prig равняется 0 то убиваем
humanoid:TakeDamage(humanoid.MaxHealth)
else -- иначе ничего не делаем
print("Prig не равняется 0")
end
end
end
end
object.Touched:Connect(touched)
Какая конкретно тебе нужна механика и что такое 'prig'?