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 10 years ago
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

Log in to vote
0
Answered by 10 years ago
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


0
Explain that he didn't Write the event Correctly though, HexC3D 830 — 10y
0
Ohh.. Roboy5857 20 — 10y
0
Ok. digitalzer3 123 — 10y
0
also MouseClick only works with ClickDetector. digitalzer3 123 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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)

Answer this question