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 » Scripting Helpers
Home Search
 

Help with a script that opens a gui?

Previous Thread :: Next Thread 
Valkyrie1146 is not online. Valkyrie1146
Joined: 09 Sep 2011
Total Posts: 84
30 Jun 2012 10:57 PM
So here is the script for a button on a gui. I want the button to lead to another gui. In other words, it should act as a "next" button.

print("Close button loaded")

button = script.Parent
window = script.Child

function onClicked(GUI)
window:add()
end
script.Parent.MouseButton1Click:connect(onClicked)

The button is the parent of the script, and the script is the parent of the next gui.
Where did I go wrong? Everywhere? Or is it that "add" isn't a word in lua language?
lol I'm not much of a scripter so plz help! THX!
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
30 Jun 2012 11:07 PM
You are failing at Lua right there.....
Okay, for one, you can't do window.Child. First of all, it only works for Parent. Second of all, to go DOWN the tree of ROBLOX, you use the NAME of the child your looking for.

So, let's say the name of "window" is Window.

    window = script.Window

Now, you have an invalid argument passed onto onClicked. MouseButton1Click does not pass down any arguments. Also, there is no such thing as the :Add() method. You will have to use the :Clone method.

    function onClicked()
      local c = window:Clone()
      c.Parent = game.Players.LocalPlayer
    end

Now, in order for this to work, you will have to put it in a LocalScript, if not, it will error.


Annoying the crap out of you, one word at a time. -Says suoicodilaipxecitsaligirfilacrepus repeatedly-
Report Abuse
Valkyrie1146 is not online. Valkyrie1146
Joined: 09 Sep 2011
Total Posts: 84
01 Jul 2012 09:46 AM
thx so much!
Like I said I'm not a scripter so I can't really script at all lol
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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