|
| 05 Jul 2016 11:18 PM |
| Well, Something decided to break! A script to make a frame visible on button click in one of my games just decided it's going to quit working. A SIMPLE SCRIPT, SIMPLE 4 LINE CODE THATS ALL CORRECT AND HAS BEEN WORKING FOR MONTHS, well, it quit working for some odd reason, the script works in play solo mode, but it won't work in the actual game. I've tried changing it to a local script, no difference. Why? I haven't messed with it AT ALL, it just quit working. Now I have to figure out a different way to write it I guess, makes no sense. |
|
|
| Report Abuse |
|
|
| |
|
Dev_Ryan
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 243 |
|
|
| 06 Jul 2016 05:23 AM |
Did you perhaps set FilteringEnabled to true in the Workspace properties? Because if you did, that could be a reason why it stopped working. It will even stop click detectors from working without a remove function/event.
|
|
|
| Report Abuse |
|
|
Dev_Ryan
|
  |
| Joined: 10 Mar 2013 |
| Total Posts: 243 |
|
|
| 06 Jul 2016 05:24 AM |
I meant "Remote" not remove lol.
But like the person above said, it would help if you post the script.
Also this thread belongs in the scripting section, not the help section.
--> https://forum.roblox.com/Forum/ShowForum.aspx?ForumID=33
|
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 06 Jul 2016 06:55 AM |
tell us the error and the script instead of complaining
|
|
|
| Report Abuse |
|
|
|
| 06 Jul 2016 08:34 AM |
| That's the issue, there is no error on the script. The script is correct, it works in the play solo mode, but not the game. |
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 06 Jul 2016 08:35 AM |
"The script is correct" how are we supposed to know what the issue is and how to fix it for you without knowing what your script is clearly it's not correct if it doesn't work
|
|
|
| Report Abuse |
|
|
|
| 06 Jul 2016 08:39 AM |
I know it's correct, because It's been working flawlessly for MONTHS now, it just decided to quit working. I haven't touched it since I wrote it.
Here is the script anyway: local frame = script.Parent.Parent.Parent:FindFirstChild('CarShop').Background script.Parent.MouseButton1Click:connect(function() frame.Visible = true end)
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 08:40 AM |
That works fine. There's a problem with your hierarchy.
If you're trying to toggle and visibility, use this:
frame.Visible = not frame.Visible
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 08:41 AM |
the*
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
| |
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 08:43 AM |
It didn't work because there is a problem with the location of your objects, as I said.
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2016 08:44 AM |
Though it still works in play solo mode. Still not in the actual game.
|
|
|
| Report Abuse |
|
|
|
| 06 Jul 2016 08:44 AM |
How could there be a displacement? I haven't touched or moved anything in months, as I SAID.
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 08:45 AM |
Is the script disabled?
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 06 Jul 2016 08:45 AM |
have you tried putting wait(.234) at the top
|
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Jul 2016 08:47 AM |
Idek how, but that worked... thank you Borsy...
|
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 06 Jul 2016 08:48 AM |
it's because in studio all instances load then scripts run, however ingame scripts load first then other instances load, so it's trying to access a frame that hasn't loaded yet
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 08:49 AM |
Try using WaitForChild() If that doesn't work, I find it hard to believe that you have everything located/named correctly. No errors?
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2016 08:49 AM |
Ah okay, well that makes sense, lol.
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 08:50 AM |
No, don't put wait(.234) at the top. That's disgusting, inefficient, and bad practice for scripting. Wait for the children using the function that was made for it.
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2016 08:51 AM |
@#Skellobit I know... but it's not like anyone is going to see my code... plus if it works, heck who cares what it looks like.
|
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 06 Jul 2016 08:53 AM |
What if it doesn't work? Clients have different loading times. If you ever need assistance in the scripting forum and you're using inefficient methods like that, you won't get help.
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2016 08:54 AM |
Then I'll change it to the WaitForChild. Lul.
|
|
|
| Report Abuse |
|
|