- First, open ROBLOX Studio by going to Start > All Programs > ROBLOX > ROBLOX Studio.
- Secondly, go to My ROBLOX > Profile > Edit my place.
- Once it is loaded, go to Insert > Object > ScreenGui.
- Drag the new ScreenGui into the StarterGui node in the explorer.
- Make sure the 'ShowDevelopmentGUI' checkbox is checked.
- Now, go to Insert > Object > TextButton.
- Move the TextButton into the ScreenGui you inserted before.
- Set the TextButton's name and text properties to "Reset".
- Set the TextButton's XAlignment property to "Center".
- Set it's position to: {0, 0}, {0.5, -10}
The position is a UDim2 position. The first table is the X and the second table is the Y. In both tables, the first number is the scale. The scale is on a scale of 0-1. Halfway would be 0.5, Quarter-way would be 0.25. The second number is the offset. The offset on the Y table is -10 because I want the TextButton to be halfway on the Y axis take away 10 pixels.
- Set it's size to: {0.1, 0}, {20, 0}
- Set the BackgroundColor3 to any color you like.
- Set the TextColor3 to any color you like (make sure it stands out from the background color.)
- Now, go to Insert > Object > Script and move the script inside of the TextButton.
- Double-click the script. Copy and paste this in:
local player = script.Parent.Parent.Parent.Parent -- Get the player function onMouseClicked() if player.Character ~= nil then -- If the player isn't respawning then if player.Character:findFirstChild("Humanoid") then -- If we can find the player's humanoid then player.Character.Humanoid:TakeDamage(100) -- Take away the player's health. end end end script.Parent.MouseButton1Down:connect(onMouseClicked) -- Connect to the onMouseClicked function when the button is pressed
- Make sure everything is setup then try it out!
Community content is available under CC-BY-SA unless otherwise noted.