local health = 100
local hasShield = true
if health > 0 then
if hasShield then
print("Игрок жив и защищён")
end
endlocal coins = 50
local level = 5
if coins >= 50 then
if level >= 5 then
print("Можно купить предмет")
end
endlocal health = 0
local hasPotion = true
if health > 0 then
print("Игрок жив")
else
if hasPotion then
print("Используем зелье")
else
print("Игра окончена")
end
endif coins >= 50 and level >= 5 then
print("Можно купить предмет")
endscript.Parent.Touched:Connect(function(hit)
local character = hit.Parent
if character:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(character)
if player then
print("Это игрок!")
end
end
end)