Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:09 PM |
So I have a start menu, and once you click play it dissapears but I want an option to go back to menu, and I cant because the back to menu button dissapears as well when you click play also I dont even know if the back to menu button works so just give me a whole script and instructions
|
|
|
| Report Abuse |
|
|
yin_yang
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 537 |
|
|
| 27 Jul 2017 11:10 PM |
"so just give me a whole script and instructions"
out the door u go |
|
|
| Report Abuse |
|
|
Vultorz
|
  |
| Joined: 02 Mar 2015 |
| Total Posts: 2985 |
|
|
| 27 Jul 2017 11:11 PM |
I will NOT give you a script, but I will give instructions.
When you click "play", make it so the GUI isn't visible instead of deleting it.
Make the button that brings you back to the GUI make it visible again. |
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:14 PM |
function clicked() if a ~= on then script.Parent.Parent.Visible = false else script.Parent.Parent:remove() end end
script.Parent.MouseButton1Click:connect(clicked)
thats my script right now do I just change remove to Enabled = False
|
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:15 PM |
I just started trying to learn scripting a few days ago I dont know much
|
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:16 PM |
then like wait 0.5 then backtomenu.visible = true or something
|
|
|
| Report Abuse |
|
|
yin_yang
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 537 |
|
|
| 27 Jul 2017 11:17 PM |
just create an anonymous function
[button].MouseButton1Click:connect(function() -- blah blah end) |
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:22 PM |
only thing I dont understand is how to make back to menu visible after
|
|
|
| Report Abuse |
|
|
Universiv
|
  |
| Joined: 11 May 2013 |
| Total Posts: 658 |
|
|
| 27 Jul 2017 11:25 PM |
| If you make your "Back to Menu" button a separate GUI, then it will not disappear when you close the menu. You should make sure to disable the "Back to Menu" button when the menu is visible, and vice versa. |
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:28 PM |
| # ## I put it in a seperate gui then will it still connect to the start menu gui and open it because I dont know how to do that lol |
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:29 PM |
and whats a script for when start menu enabled = true then "back to menu" visible = false Im just trying to learn how to translate stuff like that to lua
|
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 27 Jul 2017 11:33 PM |
if ScreenGui.Enabled = true then menu.Visible = false end
thats what I got which doesnt work I have no idea how to do this
|
|
|
| Report Abuse |
|
|
|
| 27 Jul 2017 11:37 PM |
| Instead of "script.Parent.Parent:remove()" do "script.Parent.Parent.Visible = false" |
|
|
| Report Abuse |
|
|
Universiv
|
  |
| Joined: 11 May 2013 |
| Total Posts: 658 |
|
|
| 27 Jul 2017 11:39 PM |
| If I think I know what you're asking, then yes, even if you have two GUIs in StarterGUI, you can access them both with the script you are using. (I assume it's a LocalScript in StarterGUI?) |
|
|
| Report Abuse |
|
|
Universiv
|
  |
| Joined: 11 May 2013 |
| Total Posts: 658 |
|
|
| 27 Jul 2017 11:43 PM |
There are a couple of corrections for your code up above.
First, a single = is used for assigning values. So your menu.Visible = false is correct. However, when making comparisons, you need a double equals. So
if ScreenGUI.Enabled = true then
should be
if ScreenGUI.Enabled == true then
Second, because ScreenGUI.Enabled is already a boolean, it is redundant to say " == true". Instead, a cleaner version would be:
if ScreenGUI.Enabled then |
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 28 Jul 2017 01:08 AM |
Can you give a few more examples as to when to use or not use ==
|
|
|
| Report Abuse |
|
|
|
| 28 Jul 2017 01:11 AM |
Stop rushing learning, I bet that script you got there is from a free model |
|
|
| Report Abuse |
|
|
Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
|
| 28 Jul 2017 01:12 AM |
| Issue: You aren't learning scripting. You're remembering it. It's a common mistake many beginners make, and it really messes you up in the longrun. You have to understand the code and how it works, and then you'll kinda just be able to do things off your mind. Creative thinking, is perhaps the best way to describe it. |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2017 01:17 AM |
He's just probably a kid who tries to rush scripting and tries to make an overmade game like mad murder or adopt and raise a cute baby.
I hate trash like you, I bet that you only wanted monetization and fame. Real developers find fun in scripting, not for leisure. |
|
|
| Report Abuse |
|
|
Smeers
|
  |
| Joined: 14 Feb 2013 |
| Total Posts: 797 |
|
|
| 28 Jul 2017 01:19 AM |
| Aye, I get the same grudge sometimes.. but relax, everyone starts somewhere! |
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 28 Jul 2017 11:36 AM |
Im trying to finish a game, I never touch free models I write it myself after learning from youtube videos. I hate trash like you, insulting people trying to learn something
|
|
|
| Report Abuse |
|
|
yin_yang
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 537 |
|
|
| 28 Jul 2017 11:42 AM |
| you're better off learning how people do stuff in free models |
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 28 Jul 2017 12:34 PM |
Oml I just want to try to remember the scripts so I can do it myself and all you guys are treating me like dirt, this game is no free models at all I havent opened the toolbox ever since I started making it, Im not trying to rush remembering scripts Im just asking how to do things I need to be done. Im not doing this to be "famous" and "rich" I could care less about that on ROBLOX I just want something finished that I can say I finished and feel accomplished by. wtf is all the negativity for
|
|
|
| Report Abuse |
|
|
|
| 28 Jul 2017 12:42 PM |
You're probably getting a bunch of negativity because of your OP: "so just give me a whole script and instruction" probably triggered them and they didn't read the comments where you posted a script.
People on here don't like it when people say that.
As for the == question, think of it as a comparer. In my head, whenever I see ==, I see "is equal to". When I see = I see "Equals".
You can set variables with = but not with ==.
var1 = "Hello" var2 == "World" --Wrong
use the == in if statements when you're trying to see if one thing is equal to another thing.
if var1 == "Hello" then print(var1) end
local bool = true
if bool == true then
etc.
|
|
|
| Report Abuse |
|
|
Rendevoux
|
  |
| Joined: 07 Nov 2014 |
| Total Posts: 694 |
|
|
| 28 Jul 2017 06:45 PM |
ooh so if the thing is correct like
menu==active
then it will do the command so I can do like if menu==visible then Script.Parent.Parent.Enabled = false
|
|
|
| Report Abuse |
|
|