ПроектыФорумОцените

Так вот какие успехи

#0
20:42, 7 мая 2025

Сделал почти полную систему хп
local maxHealth = 100
local regenRatePerMinute = 3  -- Скорость регенерации: 3 единицы здоровья за минуту
local bleedRatePerMinute = 10  -- Скорость кровотечения: 10 единиц здоровья за минуту

local playerHealthTable = {}

function GiveHealth(player)
    local character = player.Character or player.CharacterAdded:Wait()
    local healthBar = character:WaitForChild("HealthBar").Value
    local savedHealth = playerHealthTable[player.Name] or maxHealth
    healthBar.Value = savedHealth
end

function TakeDamage(player, amount)
    local character = player.Character
    local healthBar = character:WaitForChild("HealthBar").Value
    local currentHealth = healthBar.Value
    currentHealth = currentHealth - amount
    healthBar.Value = currentHealth
    playerHealthTable[player.Name] = currentHealth
    if currentHealth <= 0 then
        print("Игрок погиб!")
    end
end

function RegenerateHealth(player)
    local character = player.Character
    local healthBar = character:WaitForChild("HealthBar").Value
    local currentHealth = healthBar.Value
    local deltaTime = tick() - player.LastRegenTick
    local regeneratedHealth = deltaTime * (regenRatePerMinute / 60)
    currentHealth = math.min(currentHealth + regeneratedHealth, maxHealth)
    healthBar.Value = currentHealth
    player.LastRegenTick = tick()
end

function ApplyBleeding(player)
    local character = player.Character
    local healthBar = character:WaitForChild("HealthBar").Value
    local currentHealth = healthBar.Value
    local deltaTime = tick() - player.LastBleedTick
    local lostHealth = deltaTime * (bleedRatePerMinute / 60)
    currentHealth = math.max(currentHealth - lostHealth, 0)
    healthBar.Value = currentHealth
    playerHealthTable[player.Name] = currentHealth
    player.LastBleedTick = tick()
end

local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
    GiveHealth(player)
    player.LastRegenTick = tick()
    player.LastBleedTick = tick()
    while wait(1) do
        if player.Character then
            RegenerateHealth(player)
            ApplyBleeding(player)
        end
    end
end)

local player = game.Players.LocalPlayer
TakeDamage(player, 20)  -- Нанести 20 единиц урона
Спавн лута тоже сделал
local spawnZones = {}
local respawnInterval = 900  -- Интервал респауна (15 минут)

function SpawnItem(zoneType)
    local zones = spawnZones[zoneType]
    if zones then
        local randomZone = zones[math.random(1, #zones)]
        local itemInstance = workspace.Items:FindFirstChildByName("Loot_"..zoneType):Clone()
        itemInstance.Parent = workspace
        itemInstance.Position = randomZone.Position
    end
end

function RespawnItems()
    for _, zoneType in pairs({"village", "factory", "military_base"}) do
        local itemsInZone = workspace:GetChildren()
        local foundItem = false
        for _, item in pairs(itemsInZone) do
            if item.Name == "Loot_"..zoneType then
                foundItem = true
                break
            end
        end
        if not foundItem then
            SpawnItem(zoneType)
        end
    end
end

while wait(respawnInterval) do
    RespawnItems()
end

spawnZones = {
    village = {workspace.Village1, workspace.Village2},  -- Деревни
    factory = {workspace.Factory1, workspace.Factory2},  -- Фабрики
    military_base = {workspace.Base1, workspace.Base2}  -- Военные базы
}
И спавн игроков на пляже(бич зона)
local spawnZones = {}

function SpawnPlayer(player)
    local zones = spawnZones["beach"]
    if zones then
        local randomZone = zones[math.random(1, #zones)]
        local character = player.Character or player.CharacterAdded:Wait()
        character.PrimaryPart.CFrame = randomZone.CFrame
    end
end

local Players = game:GetService("Players")
Players.PlayerAdded:Connect(SpawnPlayer)

spawnZones["beach"] = {workspace.Spawn1, workspace.Spawn2, workspace.Spawn3}

#1
20:45, 7 мая 2025

Украдут же код, не успеешь и глазом моргнуть

#2
20:45, 7 мая 2025

Согласен несуразная ##### но все равно

#3
20:45, 7 мая 2025

AMM1AK
> Украдут же код, не успеешь и глазом моргнуть
Уже. Ухахаха

#4
20:49, 7 мая 2025

aliskda
Ну в принципе ок

#5
21:17, 7 мая 2025

aliskda
Вот в теме чуть выше, можно топовый 3д контент тоже намутить нахаляву
https://gamedev.ru/art/forum/?id=290113

#6
22:16, 7 мая 2025

Успешные успехи.

#7
15:57, 8 мая 2025

Успешные узбеки.

#8
20:47, 8 мая 2025

лучше в github кидай код

#9
22:06, 8 мая 2025

Что это за язык такой? Жаба скрипт?

#10
22:10, 8 мая 2025

AMM1AK
> Украдут же код, не успеешь и глазом моргнуть
Чатжпт укродёть и будет всем показывать

ПроектыФорумОцените