프로그래밍/Roblox
로블록스로 배우는 코딩 #6 - 용암을 밟으면 HP가 줄어들어요
강릉바다의 블로그
2022. 10. 6. 20:41
local player = script.Parent
local humanoid = player:FindFirstChild("Humanoid")
local deBounce = false
function lavaTouch(part)
if humanoid.FloorMaterial ~= nil and humanoid.FloorMaterial.Name == "CrackedLava" then
if not deBounce then
deBounce = true
humanoid:TakeDamage(10)
wait(1)
deBounce = false
end
end
end
humanoid.Running:Connect(lavaTouch)
강릉바다의 블로그
Since 2008. 1.