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

Previous Thread :: Next Thread 
saka34 is not online. saka34
Joined: 11 Oct 2010
Total Posts: 369
03 Aug 2015 04:48 PM
When the player clicks the 'play' button I need two things to happen.

1. The player resets and spawns at the team spawn point(or one of them).
and 2. The gui disappears forever.

I have #1 down. How do I make the whole GUI disappear? I have a little script written. You're welcome to look.

local Button = script.Parent

function onButtonClicked()
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
Button.Parent.Visible = false


end

script.Parent.MouseButton1Click:connect(onButtonClicked)
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
03 Aug 2015 04:49 PM
Don't put it in startergui, but replicatedstorage and clone it to the player when it first joins.
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
03 Aug 2015 04:58 PM
-- If this is in a LocalScript, you can also try this:

local Button, Create = script.Parent, assert(LoadLibrary("RbxUtility")).Create
local Player = game:GetService("Players").LocalPlayer

function onScriptLoaded()
if (Player:FindFirstChild(Button.Parent.Name.."_Hidden")) then
Button.Parent.Visible = false
end
end

function onButtonClicked()
Player.Character.Humanoid.Health = 0
Button.Parent.Visible = false
Create"BoolValue"{Name=Button.Parent.Name.."_Hidden";Parent=Player}
end

Button.MouseButton1Click:connect(onButtonClicked)
onScriptLoaded()
Report Abuse
saka34 is not online. saka34
Joined: 11 Oct 2010
Total Posts: 369
03 Aug 2015 05:15 PM
It doesn't work. :(
Report Abuse
saka34 is not online. saka34
Joined: 11 Oct 2010
Total Posts: 369
03 Aug 2015 07:28 PM
Any other suggestions?
Report Abuse
saka34 is not online. saka34
Joined: 11 Oct 2010
Total Posts: 369
04 Aug 2015 09:23 AM
How would I clone it to the player?
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
04 Aug 2015 09:25 AM
put it in startergui ...
Report Abuse
saka34 is not online. saka34
Joined: 11 Oct 2010
Total Posts: 369
04 Aug 2015 09:41 AM
It IS in StarterGui. I just don't know how to remove it from the screen.
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
04 Aug 2015 09:49 AM
script.Parent.Visible = false
Report Abuse
Darkenus is not online. Darkenus
Joined: 17 Jul 2014
Total Posts: 1997
04 Aug 2015 10:04 AM
Put it in Replicated Storage. When their PLAYER IS ADDED, clone it to their gui. Then, when they click play, destroy the gui.
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
04 Aug 2015 10:21 AM
-- Create a new Script in ServerScriptService, paste in the following code, and place your GUI inside the script. This should work.

local Players = game:GetService("Players")

function OnPlayerAdded(Player)
repeat wait() until #script:GetChildren() > 0
local CloneGUI = script:GetChildren()[1]:Clone()
CloneGUI.Parent = Player.PlayerGui
end

Players.PlayerAdded:connect(OnPlayerAdded)
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