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

Why won't my Intro won't work?

StartButton = game.Workspace.StarterGui.Start
back = game.Workspace.StarterGui.ScreenGui

function MouseClick(Start)
	Start:Destroy()
	back:Destroy()
end

script.Parent.Click:connect(MouseClick)

when you click the StartButton, it destroys the back and the startbutton. But, it won't work! D: Why?

2 answers

StartButton = game.StarterGUI.ScreenGUI.Start
back = game.StarterGUI.ScreenGUI

function MouseClick(Start)

start:Destroy()
back:Destroy()

end

script.Parent.MouseButton1Click:connect(MouseClick)

-- want to return the gui after? well here you have it
wait(3)
return gui


4 comments

0

Explain that he didn't Write the event Correctly though,

0

Ohh..

0

Ok.

0

also MouseClick only works with ClickDetector.

try this

gui = game.StarterGUI.ScreenGUI-- declare the gui
gui.start.MouseButton1Down:connect(function()-- call a function that checks if the button was clicked
gui:Destroy()--destroys the whole gui in one shot
end)

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