EngediKimHyeYoung / Roblox

0 stars 0 forks source link

용암 밟으면 체력감소하고, 샘물에 들어가면 체력 올라가기 #19

Open EngediKimHyeYoung opened 3 years ago

EngediKimHyeYoung commented 3 years ago

local playerID = script.Parent local hum = playerID:FindFirstChildWhichIsA("Humanoid")

function lavaDamage(character) if hum.FloorMaterial ~= nill then local condition = true

    while condition do
        if hum.FloorMaterial.Name == "CrackedLava" then
            hum.Health = hum.Health - 1
            print(hum.Health)
            wait(1)
        end
        condition = false
    end
end

end

function springHeal(character) hum.Health = hum.Health + 1 print(hum.Health) end

hum.Running:Connect(lavaDamage) hum.Swimming:Connect(springHeal) print(hum.Health)