Tutorial:Making a Kill Button

In this tutorial, we will go over making a basic kill button. In order to complete this tutorial, you will need to have a basic knowledge with GUIs. Some helpful gui teaching links are shown below. Lets begin!
 * Tutorial:GUI
 * Tutorial:GUIs: Introduction

The first step is to make the gui. To do this tutorial, we are going to put a into a, then insert a  into the button. Your hierarchy should look like this.

Open up the LocalScript, delete all the current code. Now, we can start by defining variables.

Now, we can hook up our event.

We have our event hooked up, but we need to make it actually kill the player. To do this, we find the object inside of the player's character, and set it's health to 0.

This button will now instantly kill any player who presses it.