|
| 07 Nov 2012 07:14 PM |
game.Players.PlayerAdded:connect(function(player) game.Players.player.PlayerGui.FlashLight.Script.MouseButton2Click:connect() f = game.Players.player.PlayerGui.FlashLight l = f.Left m = f.Main r = f.Right if f.l.Active == true then f.l.Active = false f.r.Active = false f.m.Active = false else f.l.Active = true f.r.Active = true f.m.Active = true end end)
No output errors. And what I basically want it to do is, either turn on or off the flashlight gui. If it's off, then it gets turned on, and vice versa. Please, help. |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2012 07:16 PM |
| To me it looks like you're clicking a script instead of a button. |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2012 07:17 PM |
| My bad there's no button t_t |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2012 07:19 PM |
Added a button. Script now (still not working)
game.Players.PlayerAdded:connect(function(player) game.Players.player.PlayerGui.FlashLight.TextButton.MouseButton2Click:connect() f = game.Players.player.PlayerGui.FlashLight l = f.Left m = f.Main r = f.Right if f.l.Active == true then f.l.Active = false f.r.Active = false f.m.Active = false else f.l.Active = true f.r.Active = true f.m.Active = true end end) |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 05:26 PM |
| Do you have a model? It'd be much easier for me to see what's wrong. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 05:28 PM |
No, but heres what it is.
In StarterGui, there is a Gui named, "FlashLight" Inside contains 5 things, Left (picture) Main (picture) Right (picture) Script (obviously a script, which is what is the problem) and TextButton
The script is LOCATED in the Flashlight gui |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 05:29 PM |
game.Players.PlayerAdded:connect(function(player) game.Players.player.PlayerGui.FlashLight.TextButton.MouseButton2Click:connect() f = game.Players.player.PlayerGui.FlashLight l = f.Left m = f.Main r = f.Right if l.Active == true then l.Active = false r.Active = false m.Active = false else l.Active = true r.Active = true m.Active = true end end)
Try it like this? |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 05:30 PM |
| I already told you how to fix this in another thread. StarterGui just holds the GUIs. You have to change the PlayerGui to see an effect. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 05:30 PM |
| I did. I changed it to PlayerGui. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 05:31 PM |
See, right here (just a section of the script) game.Players.PlayerAdded:connect(function(player) game.Players.player.PlayerGui.FlashLight.Script.MouseButton2Click:connect() f = game.Players.player.PlayerGui.FlashLight l = f.Left
|
|
|
| Report Abuse |
|
|
| |
|
SirGalith
|
  |
| Joined: 24 Jan 2010 |
| Total Posts: 209 |
|
|
| 08 Nov 2012 06:35 PM |
| try MouseButton2Down instead of MouseButton2Click |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 06:41 PM |
When a Player is Added, the PlayerGui and GUIs in it don't yet Exist
repeat wait() until ply:findFirstChild("PlayerGui") repeat wait() until ply.PlayerGui:findFirstChild("Flashlight") |
|
|
| Report Abuse |
|
|
XhymbbQd6
|
  |
| Joined: 22 Jul 2011 |
| Total Posts: 1468 |
|
|
| 08 Nov 2012 06:41 PM |
| I am pretty sure its MouseButton2Down... And or Up. I use that for my Guis. |
|
|
| Report Abuse |
|
|
SirGalith
|
  |
| Joined: 24 Jan 2010 |
| Total Posts: 209 |
|
|
| 08 Nov 2012 06:48 PM |
Y does he have to access the textButton by
game.Players.player.FlashLight.TextButton
instead of
script.Parent.TextButton |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 06:49 PM |
game.Players.PlayerAdded:connect(function(player) game.Players.player.PlayerGui.FlashLight.Script.MouseButton2Click:connect() f = game.Players.player.PlayerGui.FlashLight
SHOULD BE:
game.Players.PlayerAdded:connect(function(player) player.PlayerGui.FlashLight.Script.MouseButton2Click:connect() f = player.PlayerGui.FlashLight |
|
|
| Report Abuse |
|
|