How do you make a trap code, because I only know how to make them die, will this help u answer :
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local human = character:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(character)
if player and human.Health > 0 then
human.Health = 0
end
end)

3 comments
Put ALL of your code in a code block.
Ok
Ok