|
| 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
|
  |
| 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 |
|
|
| 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 |
|