Your tutorials can be on any development topic, as long as it is related to Roblox development, and as long as it conveys a significant amount of information. Topics that are not about (Roblox) development should probably go into a different forum category, as well as topics that are really simple or short.
Make sure to add step-by-step instructions in your tutorials! You should detail and explain your steps as best you can, and remember that not everyone might have your particular set of skills.
When possible, be sure to include images or videos to make your explanation as clear and easy to follow as possible.
Please consider using Community Resources category if your topic does not fit the format of a tutorial.
Making the UI
It is very simple.
- Make a ScreenGui and add a TextLabel.
2 [optional]. If youâre willing for this to be mobile compatible, use an offset to scale plugin on both the text and the other elements that will be listed in this section of the tutorial.
3 - Insert a TextButton object to the ScreenGui and set its text to be âStartâ.
4 (optional) - Set the background color of the button to be green, and the text color to be white. You can round the corners by adding an UICorner to the button.
CODING
- Add a LocalScript to the TextLabel. Make sure it is not enabled.
- Paste in this code:
local label = script.Parent
local Time = 0
while true do
Time += 0.1
label.Text = tostring(Time)
wait(0.1)
end
What this code does: It will define what the label variable is, which in this case is the TextLabel. Then it will define another variable called Time. Then there will be a loop that goes on forever (while true loop) that will change the Time variable and the display every 0.1 seconds. (Donât worry! This script can be stopped by either enabling or disabling it!
- Add this localscript to the text button:
local button = script.Parent
local ToggleMode = "Start"
button.MouseButton1Click:Connect(function()
if ToggleMode == "Start" then
ToggleMode = "Reset"
button.Text = "Reset"
script.Parent.Parent.TextLabel.LocalScript.Enabled = true
else
ToggleMode = "Start"
button.Text = "Start"
script.Parent.Parent.TextLabel.LocalScript.Enabled = false
end
end)
What this does: It will define the button as the parent of the script that runs the code above. Next it will define ToggleMode, a string value that determines if it will reset or start next click. There is an event that fires when the button is clicked. The if statement will check if the ToggleMode string is âStartâ. If it is, then it will enable the timer script on the TextLabel and vice-versa.
You completed this tutorial!