Showing posts with label 1-Script-A-Week. Show all posts
Showing posts with label 1-Script-A-Week. Show all posts

9/24/11

The First "1-Script-A-Week"! "Kill Brick" Script!

Hey guys for the first "1-Script-A-Week" I will be telling you how to make a "Kill Brick".
Basically what this does is kill your character (makes your health 0).
These are also known as "Lava Bricks".

1.
Open ROBLOX studio, press "insert", press "object", and then click "Part" and "Ok".
2.
Select the brick in explorer and go to "insert"<"object" and then press "Script"
3.
Copy and paste this code into the script and it should work!
function onTouch(part)
local humanoid = part.Parent:findFirstChild("Humanoid")
if (humanoid ~=nil) then
humanoid.Health = 0
end
end

script.Parent.Touched:connect(onTouch)


After that you might want to anchor it and recolor/resize it to fit your game!
Have fun!

-liama517