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
 

Script wont work

Previous Thread :: Next Thread 
DarkCreepers is not online. DarkCreepers
Joined: 29 Mar 2013
Total Posts: 915
17 Jul 2014 05:12 PM
This wont work, it's a button on a gui when they click ok, it's suppose to open another gui and close it's self, help. Here's the script

game.Lighting.ScreenGui:clone().Parent = game.StarterGui
Wait(1)
Report Abuse
BobbyisLOLZ is not online. BobbyisLOLZ
Joined: 17 Aug 2010
Total Posts: 8045
17 Jul 2014 05:14 PM
close itself?
whats after the wait(1)?
Report Abuse
DarkCreepers is not online. DarkCreepers
Joined: 29 Mar 2013
Total Posts: 915
17 Jul 2014 05:15 PM

end

script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
17 Jul 2014 05:15 PM
You need to clone it into their PlayerGui. Until you know more, avoid editing StarterGui.
Report Abuse
BlupoV2 is online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
17 Jul 2014 05:15 PM
So, it's in a function, correct?
Report Abuse
MrTucan1996 is not online. MrTucan1996
Joined: 19 Aug 2009
Total Posts: 5994
17 Jul 2014 05:16 PM
Your script puts the GUI into the games StarterGUI..

Put it in the Players startergui so that way the person who clicks also get the GUI.
Report Abuse
DarkCreepers is not online. DarkCreepers
Joined: 29 Mar 2013
Total Posts: 915
17 Jul 2014 05:16 PM
Still doesn't work.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
17 Jul 2014 05:17 PM
Code?
Report Abuse
Scriptos is online. Scriptos
Joined: 17 Jun 2008
Total Posts: 2900
17 Jul 2014 05:17 PM
script.Parent.MouseButton1Down:connect(function()
game.Lighting.ScreenGui:clone().Parent=script.Parent.Parent.Parent;
script.Parent:Destroy();
end);



This will work assuming that;

1.) The script is inside of a button.

2.) The button is inside of a screen gui.

3.) The screen gui is inside of a player's PlayerGui.

4.) There is an object in lighting named ScreenGui.
Report Abuse
DarkCreepers is not online. DarkCreepers
Joined: 29 Mar 2013
Total Posts: 915
17 Jul 2014 05:17 PM
The entire thing

print("Close button loaded")

button = script.Parent
window = script.Parent.Parent.Parent

function onClicked(GUI)
window:remove()

game.Lighting.ScreenGui:clone().Parent = game.PlayerGui

end

script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
Scriptos is online. Scriptos
Joined: 17 Jun 2008
Total Posts: 2900
17 Jul 2014 05:18 PM
You may want to add an extra parent on to that, my mistake.

script.Parent.MouseButton1Down:connect(function()
game.Lighting.ScreenGui:clone().Parent=script.Parent.Parent.Parent;
script.Parent.Parent:Destroy();
end);
Report Abuse
DarkCreepers is not online. DarkCreepers
Joined: 29 Mar 2013
Total Posts: 915
17 Jul 2014 05:18 PM
@Scriptos, I did all that.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
17 Jul 2014 05:18 PM

You add it to the player's PlayerGui
Report Abuse
MrTucan1996 is not online. MrTucan1996
Joined: 19 Aug 2009
Total Posts: 5994
17 Jul 2014 05:19 PM
script.Parent.MouseButton1Click:connect(function()

Clone = game.Lighting.ScreenGui:Clone()
Clone.Parent = player:WaitForChild("PlayerGui")
wait(1)

end)


Something like that...
Report Abuse
DarkCreepers is not online. DarkCreepers
Joined: 29 Mar 2013
Total Posts: 915
17 Jul 2014 05:19 PM
SCritpos, Your code worked. Thank you.
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