Download Article
Download Article
Kill blocks are parts you can create as where a person steps on it, the user will die or lose a specific amount of health. On Roblox, it's very possible! To create a good game, you have to and should know the basics of Lua, and this article will teach you who to make a kill script, and hopefully improve your overall knowledge! So if you're interested in making a block kill a user when they touch it, read on!
Steps
If you already have Roblox Studio installed, feel free to skip this section.
-
Head to the Create tab ( www.roblox.com/Create ). You need to download Roblox Studio if you don't have it installed. Roblox Studio is the platform to create a game on Roblox, where all the games are created.
- Roblox Studio is currently only available on Windows and Mac. You can download Roblox Studio on a Chromebook, but you will need Linux. Please note that Linux devices (excluding Chromebooks), mobile devices, consoles, etc. will not work and are not compatible.
-
Click Start Creating . It should be the very large button in the middle of the screen.Advertisement
-
Click Download Studio .
-
Open up the download when it is complete. This is the installation package.
- On Chrome, click the bottom box and the bottom of your screen. It will automatically open. If you closed it, you can use Ctrl + J to check the download.
- On Microsoft Edge, it will prompt you when it's done downloading.
-
Wait. A blue Roblox (Roblox Studio), will open up. It will tell you that it's installing. Depending on your network connection, the download time may vary, but it should be quick!
- After it's complete, it might close, but don't worry. That's part of the process. When it closes, a new menu will open afterward!
-
Log in. After the installation menu closes, a new window will open up shortly. You'll see a log in menu.
- In the Username box, fill in your Roblox username.
- In the Password box, fill in your Roblox password corresponding to your account.
-
Click the "New" button on your left menu. In there, select any template you want!
- Your template isn't too important, depending on what exactly you want your game to be like.
-
Wait for your game to open. It might take some time!
Advertisement
-
Click Model when your game opens up. It should be located on the top menu. A "model" is a combined object of parts, but you only need a part to make a kill block.
-
Add a part. Click Part under the model tab. There should be a drop-down button once you click on it. Select the type of block you want to use.
- It doesn't matter about the shape of the model. It all can be used as a kill block!
-
Find your model in the Explorer menu. The Explorer menu is the menu on the right side of your screen. Your part should be automatically named "Part." Find your part and click on it.
- Remember to only click on it once.
-
Find the + sign right next to your part. It should be "Part +". Click on the + .
-
Click Script in the menu that pops up. It should look like a blue scroll.
Warning! Remember to click Script , not Local Script or Module Script .
Advertisement
-
Delete the
print("Hello World")
that automatically appears. -
Type in the below code.
local trapPart = script . Parent local function onPartTouch ( otherPart ) local partParent = otherPart . Parent local humanoid = partParent : FindFirstChild ( "Humanoid" ) if humanoid then humanoid . Health = 0 end end trapPart . Touched : Connect ( onPartTouch )
-
Close the script tab. There should be a "X" button below your top menu. Remember, only close script! Your script will save automatically.
-
Test out your model! In the Test tab on your top menu, click the blue Play . Touch the block and you'll notice that you died!
Advertisement
Community Q&A
Search
-
QuestionCan you keep removing a certain amount of health or does it always have to kill you immediately?AlexTop AnswererIn the line humanoid.Health = 0, you can change the 0 to match whatever health you want the player to be when they touch the block.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Tips
-
Thanks
- Go ahead and try to make a few of your own code regarding that. Mess around and something will always work!Thanks
- Remember that the smallest error in your code can make things go wrong.Thanks
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement
About This Article
Thanks to all authors for creating a page that has been read 58,668 times.
Reader Success Stories
- "It worked and that's all I can say. Very simple explanation."
Advertisement