generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: question

Previous Thread :: Next Thread 
zac4545 is not online. 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 is not online. zac4545
Joined: 19 Aug 2009
Total Posts: 2324
25 Aug 2012 11:30 PM
nobody is helping


shame
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. zac4545
Joined: 19 Aug 2009
Total Posts: 2324
25 Aug 2012 11:32 PM
thanks yo
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Aug 2012 11:33 PM
no prob yo

¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3]
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
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 is not online. zac4545
Joined: 19 Aug 2009
Total Posts: 2324
25 Aug 2012 11:38 PM
those seem to not work


what
Report Abuse
zac4545 is not online. zac4545
Joined: 19 Aug 2009
Total Posts: 2324
25 Aug 2012 11:42 PM
nevermind

im just dumb
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image