Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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?

0
Ok superbestguy567 0 — 3y
0
did it work? GameBuilderLol 58 — 3y
0
no superbestguy567 0 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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)
0
Can you tell me what happened when you tried to test it? GameBuilderLol 58 — 3y

Answer this question