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: Hey, can you help me fix my inventory GUI?

Previous Thread :: Next Thread 
monsterMrMcMan is not online. monsterMrMcMan
Joined: 20 Jun 2010
Total Posts: 463
26 Dec 2013 06:58 PM
Ok I made this script to have an inventory apear. So in StarterGui I have a Gui with a frame and text Button. the txt button includes the script below. However when I go to test it I turn my Frame to invisible and I go to start server start player and it doesn't work.

function Click(hi)
frame = script.Parent.Parent:FindFirstChild("Frame")
if frame ~= nil then
frame.Visible = false
else
Print ('WTF')
end
end
script.Parent.Clicked:connect(Click)


Thank you kind person.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
26 Dec 2013 07:01 PM
script.Parent.MouseButton1Down:connect(function(hi)
frame = script.Parent.Parent:FindFirstChild("Frame")
if frame ~= nil then
frame.Visible = false
else
Print("WTF")
end
end)
Report Abuse
monsterMrMcMan is not online. monsterMrMcMan
Joined: 20 Jun 2010
Total Posts: 463
26 Dec 2013 07:03 PM
Didn't work, mate.
Report Abuse
VesperoBLOX is not online. VesperoBLOX
Joined: 10 Nov 2013
Total Posts: 88
26 Dec 2013 07:03 PM
So, what I'm understanding is you want an inventory to appear when a button is clicked? If so, read further. You must define the clicking function this way:
function Click()
-- You do not put what is clicked in parentheses. You must use MouseClick1Down to define the clicking function..
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
26 Dec 2013 07:05 PM
Are you sure you defined "Frame" as it should be? Is the actual frame called Frame?
Report Abuse
VesperoBLOX is not online. VesperoBLOX
Joined: 10 Nov 2013
Total Posts: 88
26 Dec 2013 07:05 PM
function Click()
script.Parent.MouseButton1Down:connect
frame = script.Parent.Parent:FindFirstChild("Frame")
if frame ~= nil then
frame.Visible = false
else
Print("WTF")
end
end
-- This should be correct.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
26 Dec 2013 07:06 PM
^ Dude, you forgot (function()
Report Abuse
VesperoBLOX is not online. VesperoBLOX
Joined: 10 Nov 2013
Total Posts: 88
26 Dec 2013 07:07 PM
Whoops, I'm failing today. Kinda tired, don't use that one, it probably will error.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
26 Dec 2013 07:09 PM
Mine should work perfectly fine unless he didn't located the Frame correctly.
Report Abuse
VesperoBLOX is not online. VesperoBLOX
Joined: 10 Nov 2013
Total Posts: 88
26 Dec 2013 07:10 PM
Yeah, assuming he didn't, he needs to do that.
Report Abuse
monsterMrMcMan is not online. monsterMrMcMan
Joined: 20 Jun 2010
Total Posts: 463
26 Dec 2013 07:10 PM
It didn't work.
function onClick(hi)
frame = game.StarterGui.HeroMorphs.Frame.Visible
if frame == false then
frame = true
end
end
script.Parent.MouseClick1Down:connect(onClick)
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Dec 2013 07:11 PM
lol the if statement isn't useful
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Dec 2013 07:11 PM
why is (hi) there
Report Abuse
monsterMrMcMan is not online. monsterMrMcMan
Joined: 20 Jun 2010
Total Posts: 463
26 Dec 2013 07:12 PM
Yeah
Report Abuse
VesperoBLOX is not online. VesperoBLOX
Joined: 10 Nov 2013
Total Posts: 88
26 Dec 2013 07:12 PM
@above
I'm assuming he has no idea how clicking functions work..
Report Abuse
VesperoBLOX is not online. VesperoBLOX
Joined: 10 Nov 2013
Total Posts: 88
26 Dec 2013 07:12 PM
Not at above @2 above.
Report Abuse
monsterMrMcMan is not online. monsterMrMcMan
Joined: 20 Jun 2010
Total Posts: 463
26 Dec 2013 07:13 PM
Yeah I'm a bad script an a good builder who doesn't want to use free m0dels but is about to D:
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Dec 2013 07:13 PM
actually vespero when you said @2 about you meant three.
Report Abuse
CrniOrao is not online. CrniOrao
Joined: 12 Oct 2008
Total Posts: 2274
26 Dec 2013 07:13 PM
Dude, if you edit StarterGui it won't work...

Try this, and put it into a Local Script:

player = game.Players.LocalPlayer

script.Parent.MouseButton1Down:connect(function()
frame = player.PlayerGui.HeroMorphs.Frame
if frame.Visible = false then
frame.Visible = true
else
print("Your argument is invalid!")
end
end)
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Dec 2013 07:15 PM
here

sp = script.Parent
frame = game.StarterGui.HeroMorphs:findFirstChild("Frame")

sp.MouseButton1Clicked:connect(function()
frame.Visible = not frame.Visible --it's a toggle (i think thats what you want
end)
Report Abuse
monsterMrMcMan is not online. monsterMrMcMan
Joined: 20 Jun 2010
Total Posts: 463
26 Dec 2013 07:16 PM
THANK YOU MAN :D
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
26 Dec 2013 07:18 PM
oops

Put this in a localscript


sp = script.Parent
frame = game.Player.LocalPlayer.PlayerGui.HeroMorphs:findFirstChild("Frame")

sp.MouseButton1Clicked:connect(function()
frame.Visible = not frame.Visible --it's a toggle (i think thats what you want
end)
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