|
| 10 Aug 2015 04:45 AM |
ts = game.workspace.ThemeSong user = game.Players.LocalPlayer
ts:Play()
function onClicked() if user.mouse1button.Play then wait(0.1) ts.Volume = 0 game.StarterGUI.ScreenGUI:destroy() end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- It's supposed to delete the ScreenGui and Stop the Song. (Not remove the song) |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
| |
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 10 Aug 2015 04:58 AM |
| Not sure what this is though: "if user.mouse1button.Play then" |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2015 05:00 AM |
I am quite a newbie at scripting and I think it means 'If user clicks on Play then'
And if I do ts:Stop it completely just stops the song without the clicking the button. |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 10 Aug 2015 05:07 AM |
| Is this located in a brick or a GUI? |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2015 05:09 AM |
| It's located in Play (TextButton) |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 10 Aug 2015 05:15 AM |
ts = workspace.ThemeSong user = game.Players.LocalPlayer
ts:Play()
script.Parent.MouseButton1Click:connect(function() ts:Stop() game.StarterGUI.ScreenGUI:destroy() end) |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 10 Aug 2015 05:16 AM |
ClickDetectors are used in bricks. Gui Text Buttons have a different method of determining if it has been clicked.
|
|
|
| Report Abuse |
|
|
|
| 10 Aug 2015 05:18 AM |
Didn't work. This was My Output:
11:17:20.517 - MouseButton1Click is not a valid member of TextBox 11:17:20.519 - Script 'Players.Player.PlayerGui.ScreenGui.Play.Script', Line 6 |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2015 05:19 AM |
| Wtf? I didn't know that Play was a TextBox. |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 10 Aug 2015 05:20 AM |
| Wellll that would be why. Haha. It needs to be a TextButton and it should work fine. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2015 05:26 AM |
It worked but it didn't.
All it did was stop the music, but it didn't delete the ScreenGUI or Play. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2015 05:30 AM |
Output:
11:25:54.758 - StarterGUI is not a valid member of DataModel 11:25:54.760 - Script 'Players.Player.PlayerGui.ScreenGui.Play.Script', Line 8 |
|
|
| Report Abuse |
|
|
| |
|