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

How do I make the tutorial gui wait until the player clicks a button?

Asked by 2 years ago
script.Parent.MouseButton1Click:Connect(function()
    local continue3 = script.Parent.Parent.Continue3

    continue3.Visible = false
    local text = "Click the ''Edit'' button on the rigt of the screen"
    local continue4  = script.Parent.Parent.Continue4
    local textMain = script.Parent.Parent.TextMain

    for i = 1, #text do
        textMain.Text = string.sub(text, 1, i)
        wait()
    end

    local edit = game.StarterGui.Screen.Right.EditButton
    local tutorial = game.StarterGui.Tutorial.TutorialFrame

    edit.MouseButton1Click:Wait()
        continue4.Visible = true
        tutorial:TweenPosition(UDim2.new(0.013,0,0.254,0), "Out", "Linear" 1, true)
        edit.Enabled = true
end)

So basically, when the player clicks "continue" on the tutorial, it tells them to click the Edit button and then after they click it the gui slides aside and allows the player to continue.

It won't work

1 answer

Log in to vote
0
Answered by 2 years ago

You forgot the :Connect(function()). Also, a typo on the text. You will need a boolean aswell.

--Don't forget to add all the other stuff.
local bool = false
edit.MouseButton1Click:Connect(function()
    if bool == false then
        bool = true
        wait()
        continue4.Visible = true
        tutorial:TweenPosition(UDim2.new(0.013,0,0.254,0), "Out", "Linear" 1, true)
        edit.Enabled = true
    end
end)
0
It won't work DiOrOmG2 0 — 2y
0
I think a cleaner way to do this would be to wait for the event using edit.MouseButton1Click:Wait(), but it doesn't work anyways so idk OfficerBrah 494 — 2y
Ad

Answer this question