본문 바로가기

Roblox

[Roblox] 닿으면 플레이어 죽이는 파트 (Part that kills the player when touched)

-- Workspace - Part - Script
local lava = script.Parent
local function killPlayer(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
lava.Touched:Connect(killPlayer)

Reference : https://developer.roblox.com/en-us/onboarding/deadly-lava/2