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

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

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

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)

2 comments

0

It won't work

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

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