Skip to content

Instantly share code, notes, and snippets.

@modster
Created September 21, 2021 04:09
Show Gist options
  • Save modster/2cd041375c69f06f616af3abf4a3d1cd to your computer and use it in GitHub Desktop.
Save modster/2cd041375c69f06f616af3abf4a3d1cd to your computer and use it in GitHub Desktop.
Kill Player on Touched Event
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)
-- https://developer.roblox.com/en-us/onboarding/deadly-lava/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment