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

how do i make a brick that kill?

I nee d help scripting a killbrick

2 comments

0

This is scriptinghelpers not scriptingmakers.

0

Yea he needs help with a script

2 answers

✓ Accepted answer

I got the script hope this helps :D im editing cuz i made a better one

--Vortex_Vasne's KillScript
function onTouch(part) 
	local humanoid = part.Parent:FindFirstChild("Humanoid") 
	if (humanoid ~= nil) then	
	humanoid.Health = 0	--set if you want to heal/kill
end 
end

script.Parent.Touched:connect(onTouch)

6 comments

0

thanks for the answer, plesae make sure to put your code inside of a code block though.

0

o

0

do you know how to do it?

0

no

0

late reply, but i think you figured it out

0

use :Connect() not :connect()

alright, i know someone has already posted, but ill do this in lua script so its easier to understand.

--This code is from roblox dev wiki. By flares!
    local Part = script.Parent
     
    local function onPartTouch(Part)
    	local PartParent = Part.Parent
    	local humanoid = PartParent:FindFirstChildWhichIsA("Humanoid")
    	if humanoid then
    		-- Set player's health to 0
    		humanoid.Health = 0
    	end
    end
   Part.Touched:Connect(onPartTouch) 

hope you enjoy!

1 comment

0

uh u wrote the same thing as him

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