zac4545
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 2324 |
|
|
| 25 Aug 2012 11:27 PM |
function OnTouch(part) local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil ) then local check = game.Players:findFirstChild(part.Parent.Name) local gui = check.PlayerGui.DarknessGUI.Frame gui.Visible = true else if gui.Visible = true then gui.Visible = false end end
script.Parent.Touched:connect(OnTouch)
basically, it's supposed to activate a gui frame in the local player and if the frame is visible then deactivate, but for some reason it dosen't work
help ): |
|
|
| Report Abuse |
|
|
zac4545
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 2324 |
|
| |
|
|
| 25 Aug 2012 11:31 PM |
You didn't check "check", and using ifs you would use two equal signs if you use gui.Visible== whatever, or with booleans, just gui.Visible. But since I'm awesome, I'll use pcall. C:
function OnTouch(part) pcall(function() local check = Game.Players:GetPlayerFromCharacter(part.Parent) local gui = check.PlayerGui.DarknessGUI.Frame if not gui.Visible then gui.Visible = false else gui.Visible = true end end) end script.Parent.Touched:connect(OnTouch)
¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3] |
|
|
| Report Abuse |
|
|
zac4545
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 2324 |
|
| |
|
|
| 25 Aug 2012 11:33 PM |
no prob yo
¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3] |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 11:34 PM |
wait i fail change:
if not gui.Visible then gui.Visible = false else gui.Visible = true end end)
to
if not gui.Visible then gui.Visible = true else gui.Visible = false end end)
¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3] |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 11:37 PM |
................
you could just do gui.Visible = not gui.Visible
¬ SHG Scripter Tier-2, LuaLearners Elite - pm me! |
|
|
| Report Abuse |
|
|
zac4545
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 2324 |
|
|
| 25 Aug 2012 11:38 PM |
those seem to not work
what |
|
|
| Report Abuse |
|
|
zac4545
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 2324 |
|
| |
|