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

Why won't my Intro won't work?

Asked by 11 years ago
1StartButton = game.Workspace.StarterGui.Start
2back = game.Workspace.StarterGui.ScreenGui
3 
4function MouseClick(Start)
5    Start:Destroy()
6    back:Destroy()
7end
8 
9script.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

Log in to vote
0
Answered by 11 years ago
01StartButton = game.StarterGUI.ScreenGUI.Start
02back = game.StarterGUI.ScreenGUI
03 
04function MouseClick(Start)
05 
06start:Destroy()
07back:Destroy()
08 
09end
10 
11script.Parent.MouseButton1Click:connect(MouseClick)
12 
13-- want to return the gui after? well here you have it
14wait(3)
15return gui
0
Explain that he didn't Write the event Correctly though, HexC3D 830 — 11y
0
Ohh.. Roboy5857 20 — 11y
0
Ok. digitalzer3 123 — 11y
0
also MouseClick only works with ClickDetector. digitalzer3 123 — 11y
Ad
Log in to vote
0
Answered by 11 years ago

try this

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

Answer this question