I nee d help scripting a killbrick
✓ ANSWER ACCEPTED
how do i make a brick that kill?
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.

2 comments
This is scriptinghelpers not scriptingmakers.
Yea he needs help with a script