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: GUI script working in studio, but not ingame

Previous Thread :: Next Thread 
WatchtowerRobin is not online. WatchtowerRobin
Joined: 11 Feb 2012
Total Posts: 253
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
ASpoonfullOfSucrose is not online. ASpoonfullOfSucrose
Joined: 28 Oct 2015
Total Posts: 442
04 Dec 2015 04:46 PM
That cannot be all the code.
Report Abuse
FrankieTheDino is online. FrankieTheDino
Joined: 27 Jul 2008
Total Posts: 603
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
WatchtowerRobin is not online. WatchtowerRobin
Joined: 11 Feb 2012
Total Posts: 253
04 Dec 2015 04:50 PM
puu.sh /lJyec.png
Report Abuse
WatchtowerRobin is not online. WatchtowerRobin
Joined: 11 Feb 2012
Total Posts: 253
04 Dec 2015 04:51 PM
Literally all the code
Report Abuse
3DReality is not online. 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
WatchtowerRobin is not online. WatchtowerRobin
Joined: 11 Feb 2012
Total Posts: 253
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 is not online. 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
WatchtowerRobin is not online. WatchtowerRobin
Joined: 11 Feb 2012
Total Posts: 253
04 Dec 2015 05:12 PM
Code works perfectly if not in a local script, well this is weird
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
04 Dec 2015 05:13 PM
Is data in or outside the player instance?


-wiki before u forum
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