EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
|
| 22 Oct 2017 12:49 AM |
Its my first time using gui's and such so I need some help. Here what I have in my workspace. (StarterGui>ScreenGui>TextButton>Script)
The only problem is, when the TextButton is clicked, the script doesn't run (And yes I have "TextButton.MouseButton1Click:connect(Check)"). I'm thinking maybe there;s something outside of the script that I am missing.
|
|
|
| Report Abuse |
|
|
SurKipper
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 435 |
|
| |
|
EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
|
| 22 Oct 2017 12:58 AM |
No, it wasn't. I just added one in and moved the code, but it still doesn't work.
|
|
|
| Report Abuse |
|
|
Sukadia
|
  |
| Joined: 25 Jan 2013 |
| Total Posts: 500 |
|
|
| 22 Oct 2017 01:03 AM |
TextButton is defined as script.Parent, right?
|
|
|
| Report Abuse |
|
|
EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
| |
|
Sukadia
|
  |
| Joined: 25 Jan 2013 |
| Total Posts: 500 |
|
|
| 22 Oct 2017 01:08 AM |
Can you paste the code here? It's a bit difficult to see what you have + don't have.
|
|
|
| Report Abuse |
|
|
EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
|
| 22 Oct 2017 01:09 AM |
| local TextButton = script.Parent local IsMute = false function Mute() print("Muted") game.workspace.GameMusic.Song1.Volume = 0 game.workspace.GameMusic.Song2.Volume = 0 game.workspace.GameMusic.Song3.Volume = 0 script.Parent.BackgroundColor3.new ############# IsMute = true end function UnMute() print("Unmuted") game.workspace.GameMusic.Song1.Volume = 0.5 game.workspace.GameMusic.Song2.Volume = 1 game.workspace.GameMusic.Song3.Volume = 0.5 script.Parent.BackgroundColor3.new ############# IsMute = false end function Check() if IsMute == false then Mute() else UnMute() end end TextButton.MouseButton1Click:connect(Check) |
|
|
| Report Abuse |
|
|
Maite224
|
  |
| Joined: 04 Apr 2017 |
| Total Posts: 28 |
|
|
| 22 Oct 2017 01:10 AM |
| dude i think you miss something... add me i can fix that. thought |
|
|
| Report Abuse |
|
|
EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
|
| 22 Oct 2017 01:11 AM |
Is there a better way to copy it...
|
|
|
| Report Abuse |
|
|
Maite224
|
  |
| Joined: 04 Apr 2017 |
| Total Posts: 28 |
|
|
| 22 Oct 2017 01:20 AM |
| i used to copy your script its an error |
|
|
| Report Abuse |
|
|
EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
|
| 22 Oct 2017 01:21 AM |
| local Button = script.Parent local IsMute = false function Mute() print("Muted") game.workspace.GameMusic.Song1.Volume = 0 game.workspace.GameMusic.Song2.Volume = 0 game.workspace.GameMusic.Song3.Volume = 0 script.Parent.BackgroundColor3.new ############# IsMute = true end function UnMute() print("Unmuted") game.workspace.GameMusic.Song1.Volume = 0.5 game.workspace.GameMusic.Song2.Volume = 1 game.workspace.GameMusic.Song3.Volume = 0.5 script.Parent.BackgroundColor3.new ############# IsMute = false end function Check() if IsMute == false then Mute() else UnMute() end end Button.MouseButton1Click:connect(Check) #code |
|
|
| Report Abuse |
|
|
Maite224
|
  |
| Joined: 04 Apr 2017 |
| Total Posts: 28 |
|
|
| 22 Oct 2017 01:22 AM |
| dude add me ill fix that for free :) |
|
|
| Report Abuse |
|
|
EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
|
| 22 Oct 2017 01:24 AM |
| #code local Button = script.Parent local IsMute = false function Mute() print("Muted") game.workspace.GameMusic.Song1.Volume = 0 game.workspace.GameMusic.Song2.Volume = 0 game.workspace.GameMusic.Song3.Volume = 0 script.Parent.BackgroundColor3.new ############# IsMute = true end function UnMute() print("Unmuted") game.workspace.GameMusic.Song1.Volume = 0.5 game.workspace.GameMusic.Song2.Volume = 1 game.workspace.GameMusic.Song3.Volume = 0.5 script.Parent.BackgroundColor3.new ############# IsMute = false end function Check() if IsMute == false then Mute() else UnMute() end end Button.MouseButton1Click:connect(Check) |
|
|
| Report Abuse |
|
|
EZmonkey
|
  |
| Joined: 17 Feb 2012 |
| Total Posts: 42 |
|
|
| 22 Oct 2017 01:25 AM |
I cant get this #code thing to work
|
|
|
| Report Abuse |
|
|