Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you make a text appear when you click something?

I have tried to make a text when a door is clicked but now i have decided that i want to clone a screengui instead can someone give a script. I tried to use the clone() function before and has not worked. I have even used this and still it does not work.

this is the script

script.Parent.Text.Value = false
local value = script.Parent.Text.Value

workspace.doortext.ClickDetector.MouseClick:Connect(function()
	if game.StarterGui.ScreenGui.Value.Value == true then
		if workspace.Breakabl2.Anchored == true then
			if value == false then
				value = true
				script.Parent.Sound:Play()
				script.Parent.TextLabel.Text = "I"
				wait(0.2)
				script.Parent.TextLabel.Text = "I t"
				wait(0.2)
				script.Parent.TextLabel.Text = "I th"
				wait(0.2)
				script.Parent.TextLabel.Text = "I thi"
				wait(0.2)
				script.Parent.TextLabel.Text = "I thin"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I c"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can o"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can op"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can ope"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open t"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open th"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open thi"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open this d"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open this do"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open this doo"
				wait(0.2)
				script.Parent.TextLabel.Text = "I think I can open this door"
				wait(0.2)
				script.Parent.TextLabel.Text = ""
				script.Parent.Sound:Stop()
				value = false
			end
		end
	end
end)

2 answers

Try using debounce:

local debounce = false

workspace.doortext.ClickDetector.MouseClick:Connect(function()
        if workspace.Breakabl2.Anchored == true then
            if not debounce then
                debounce = true
                script.Parent.Sound:Play()
                script.Parent.TextLabel.Text = "I"
                wait(0.2)
                script.Parent.TextLabel.Text = "I t"
                wait(0.2)
                script.Parent.TextLabel.Text = "I th"
                wait(0.2)
                script.Parent.TextLabel.Text = "I thi"
                wait(0.2)
                script.Parent.TextLabel.Text = "I thin"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I c"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can o"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can op"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can ope"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open t"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open th"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open thi"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this d"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this do"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this doo"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this door"
                wait(0.2)
                script.Parent.TextLabel.Text = ""
                script.Parent.Sound:Stop()

                wait(1)
                debounce = false
            end
        end
end)

tell me if there is something wrong ok?

3 comments

0

Ok

0

did it work?

0

no

no it didn't is there a easier way like clone and also this is the script its the same way you sent me

local debounce = false

workspace.doortext.ClickDetector.MouseClick:Connect(function()
        if workspace.Breakabl2.Anchored == true then
            if not debounce then
                debounce = true
                script.Parent.Sound:Play()
                script.Parent.TextLabel.Text = "I"
                wait(0.2)
                script.Parent.TextLabel.Text = "I t"
                wait(0.2)
                script.Parent.TextLabel.Text = "I th"
                wait(0.2)
                script.Parent.TextLabel.Text = "I thi"
                wait(0.2)
                script.Parent.TextLabel.Text = "I thin"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I c"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can o"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can op"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can ope"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open t"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open th"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open thi"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this d"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this do"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this doo"
                wait(0.2)
                script.Parent.TextLabel.Text = "I think I can open this door"
                wait(0.2)
                script.Parent.TextLabel.Text = ""
                script.Parent.Sound:Stop()

                wait(1)
                debounce = false
            end
        end
end)

1 comment

0

Can you tell me what happened when you tried to test it?

This discussion is preserved as it was. New answers, comments, and votes are closed.