Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I'm not dieing?

script.Parent.Touched:connect(function()
	if Touched then
		game.Players.ChildAdded.humanoid = 0
	end
end)

1 answer

✓ Accepted answer
local Brick = script.Parent

Brick.Touched:connect(function(Obj) -- When you touch it gets the "Leg" or "Arm"
	local Player = game:GetService("Players"):GetPlayerFromCharacter(Obj.Parent)
	-- Gets the Instance "Player"
	if Player and Player.Character then -- Obv its gonna be there... but check it anyways.
		local Humanoid  = Player.Character:WaitForChild("Humanoid") -- Find the Humanoid
		Humanoid:TakeDamage(100) -- Easy damage function.. :)
	end
 end)

This discussion is preserved as it was. New answers, comments, and votes are closed.