|
| 04 Dec 2015 04:44 PM |
Pretty much the title, a script for one of my gui's works in studio but not while actually ingame, when I check the errors it just tells me that the object I'm trying to reference isn't a valid member of the frame
code;
local s = script.Parent local data = s.Parent.Parent.Parent.Data
s.BackButton.MouseButton1Down:connect(function() s.Parent.CreditsGame:TweenPosition(UDim2.new(0, 0, 1, 0), "Out", "Quad", 3, true) s.Parent.MainGame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 3, true) end) |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2015 04:46 PM |
| That cannot be all the code. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2015 04:48 PM |
I would make sure you are linking it to the correct object.
According to your script basically it is located at script.Parent.Parent.CreditsGame and script.Parent.Parent.MainGame.
Everything else looks correct and I don't see a problem with it. Normally when it is saying that it is not a valid member, you are not linking to the correct object. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
3DReality
|
  |
| Joined: 08 Mar 2015 |
| Total Posts: 150 |
|
|
| 04 Dec 2015 04:57 PM |
local data = s.Parent.Parent.Parent.Data I don't see the variable in the code. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2015 05:01 PM |
| I should have mentioned the error is Line 4 "BackButton is not a valid member of frame" |
|
|
| Report Abuse |
|
|
3DReality
|
  |
| Joined: 08 Mar 2015 |
| Total Posts: 150 |
|
|
| 04 Dec 2015 05:07 PM |
| Try switching MouseButton1Down do MouseButton1Click and see if you get the error. |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2015 05:12 PM |
| Code works perfectly if not in a local script, well this is weird |
|
|
| Report Abuse |
|
|
|
| 04 Dec 2015 05:13 PM |
Is data in or outside the player instance?
-wiki before u forum |
|
|
| Report Abuse |
|
|