1 | local text = script.Parent.Parent.ComputerScreen.SurfaceGui.TextLabel |
2 | script.Parent.ClickDetector.MouseClick:Connect( function () |
3 | text.Text = text.Text + "H" |
4 | end ) |
this is my script. I dont know whats wrong.
You cannot add a string and string, only number and a number, instead use this:
1 | text.Text = text.Text.. "H" |
How it works: Ever time to click, it will change the text to the text, but with an added letter.
Example: The text is "H", after clicking, it will become, "HH"
Backspace:
1 | if #text.Text > = 1 then |
2 | script.Parent.Text = script.Parent.Text:sub( 1 , (#text.Text - 1 )) |
3 | end |