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 » Scripters
Home Search
 

Re: Why won't my gui work?

Previous Thread :: Next Thread 
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 06:50 AM
So I just watched a tutorial and changed the part it was making visible, to my parts.

This is the script, most of it is just shortening the names and changing the Visible property to true and false.


OpenClose = game.Workspace.StarterGui.STATS

gwork = game.Workspace.StarterGui

AgiBox = gwork.Agility
AgiText = gwork.Agility.AGItext
AgiLevel = gwork.Agility.Agilevel

DexBox = gwork.Dexteritiy
DexText = gwork.Dexteritiy.DEXtext
DexLevel = gwork.Dexteritiy.DEXlevel

LucBox = gwork.Luck
LucText = gwork.Luck.LUCtext
LucLevel = gwork.Luck.LUClevel

SenBox = gwork.Sense
SenText = gwork.Sense.SENtext
SenLevel = gwork.Sense.SENlevel

StrBox = gwork.Strength
StrText = gwork.Strength.STRtext
StrLevel = gwork.Strength.STRlevel

VitBox = gwork.Vitality
VitText = gwork.Vitality.VITtext
VitLevel = gwork.Vitality.VITlevel

Open = false

OpenClose.MouseButton1Down:connect(function(open)
if Open == false then
AgiBox.Visible = true
AgiText.Visible = true
AgiLevel.Visible = true
DexBox.Visible = true
DexText.Visible = true
DexLevel.Visible = true
LucBox.Visible = true
LucText.Visible = true
LucLevel.Visible = true
SenBox.Visible = true
SenText.Visible = true
SenLevel.Visible = true
StrBox.Visible = true
StrText.Visible = true
StrLevel.Visible = true
VitBox.Visible = true
VitText.Visible = true
VitLevel.Visible = true
Open = true
elseif Open == true then
AgiBox.Visible = false
AgiText.Visible = false
AgiLevel.Visible = false
DexBox.Visible = false
DexText.Visible = false
DexLevel.Visible = false
LucBox.Visible = false
LucText.Visible = false
LucLevel.Visible = false
SenBox.Visible = false
SenText.Visible = false
SenLevel.Visible = false
StrBox.Visible = false
StrText.Visible = false
StrLevel.Visible = false
VitBox.Visible = false
VitText.Visible = false
VitLevel.Visible = false
Open = false
end)
end)
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
29 Mar 2015 06:52 AM
it's game.StarterGui
not game.Workspace.StarterGui

and you have to change the one inside the player. not startergui.
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
29 Mar 2015 06:53 AM
change it to a local script

and change this
OpenClose = game.Workspace.StarterGui.STATS

gwork = game.Workspace.StarterGui

to this
gwork = game.Players.LocalPlayer.PlayerGui
OpenClose = gwork.STATS
Report Abuse
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 06:54 AM
I did this.

OpenClose = game.StarterGui.STATS

gwork = game.StarterGui

I don't get what you mean by the last part-
Report Abuse
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 06:54 AM
Ahh okay-
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
29 Mar 2015 06:55 AM
Starter Gui is just the thing that gets cloned to the player!
if you want to mess with it,
you have to mess with the one inside the player!!!
Report Abuse
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 06:56 AM
I've pretty much just started scripting so.

I don't have to move the gui out of StarterGui do I?
Report Abuse
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 06:56 AM
I get it now, thank you.
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
29 Mar 2015 06:57 AM
um no.
and P.S,
you have to put the localscript inside StarterGui or StarterPack, or at least a child of those things.
Report Abuse
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 06:58 AM
I put the local script inside the Button.

It still doesn't work.

And the output says

Players.Player.PlayerGui.StatScreen.STATS.LocalScript:1: unexpected symbol near '='
Report Abuse
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 07:10 AM
I tried it in the actual game, and for some reason when you enter the gui I want to open and close is already there, and some text is missing too-
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
29 Mar 2015 07:17 AM
add 'local' before all of your variables.
Report Abuse
devHide is not online. devHide
Joined: 27 Mar 2015
Total Posts: 44
29 Mar 2015 07:38 AM
It still doesn't work :p
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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