|
| 28 Jan 2017 03:17 PM |
So I have a game (Check it out it's called Button Man) and the GUI works in the studio fine but doesn't work in game... Nothing in output either. It's a local script within a screen gui, within starter gui
Script:
Box = script.Parent.Frame Button = script.Parent.TextButton Open = false Label = Box.TextLabel Button.MouseButton1Down:connect(function(open) if Open == false then Button.Text = 'Close' Box.Visible = true Label.Visible = true Open = true else if Open == true then Button.Text = 'Open' Box.Visible = false Label.Visible = false Open = false end end end)
Thanks, Weaselover2 |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 03:23 PM |
| Use prints to see which pars of the script run and which don't |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 03:24 PM |
| It works fine in Studio appears and disappears at click it just doesn't work in game... |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 03:27 PM |
theres a space between "else" and "if" which is not supposed to be there.
Its "elseif" |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 03:29 PM |
| Thanks I'll see If that is the fix. |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 03:32 PM |
Still not working >:(
Thanks for help. |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 03:38 PM |
It would make my day if someone had a fix :):):):)
|
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 03:54 PM |
| it would make my day if people actually read my replies and tried them instead of ignoring them :):):) |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 04:06 PM |
Like I said there is nothing going wrong in the studio... It works like a charm. But when I published and tried it on the website it wouldn't work
Thanks. |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 04:09 PM |
| Aren't you supposed to put 'local' before Box, Button, Open, and Label? Because I thought this was the case when naming variables in local scripts. I might be wrong |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Jan 2017 04:13 PM |
| No it just makes them global(to a certain extent) and reduces the performance |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 04:15 PM |
| Adding local didn't work could this be a glitch in the Studio??? |
|
|
| Report Abuse |
|
|
Aorda
|
  |
| Joined: 13 Jan 2012 |
| Total Posts: 243 |
|
|
| 28 Jan 2017 04:18 PM |
You probably made the locations of the things wrong, check those.
Also check the Developer Console, it should print what's wrong |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 04:22 PM |
| Ok what is the Developer Console I am new to Game Dev |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 04:26 PM |
So the Screen Gui is inside the Starter Gui and then inside that is the LocalScript , Frame and TextButton. Inside the Frame is a TextLabel |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 04:28 PM |
Been having this problem with Local objects as well. I think it's just very specific or borderline broken. |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2017 04:30 PM |
That's strange should I report it?
|
|
|
| Report Abuse |
|
|
| |
|
Aorda
|
  |
| Joined: 13 Jan 2012 |
| Total Posts: 243 |
|
|
| 01 Feb 2017 03:33 PM |
| @Weaselover2 Okay so Developer Console is the thing, which everything gets printed on. When you type "print('SomeText')" in a script, "SomeText" appears on the Developer Console. Developer Console also shows the errors in scripts, and lets you run commands. To open it, test the game in studio, or play it, then press "F9" key. It will open, and it will show you the errors. The errors are red colored. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 01 Feb 2017 03:35 PM |
local gui = script.Parent local bool = false
gui.MouseButton1Click:connect(function() bool = not bool gui.Visible = bool if bool then gui.Text = 'Close' else gui.Text = 'Open' end end)
|
|
|
| Report Abuse |
|
|
|
| 02 Feb 2017 06:59 PM |
| Anyone who was wondering, I just erased the GUI and remade it and it started working ... :P Also, is Developer Console the same thing as Output? |
|
|
| Report Abuse |
|
|
Aorda
|
  |
| Joined: 13 Jan 2012 |
| Total Posts: 243 |
|
|
| 17 Feb 2017 12:53 PM |
| Kinda... Developer Console can be used in-game too. |
|
|
| Report Abuse |
|
|