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: Menu GUI script doesn't work?

Previous Thread :: Next Thread 
ClickNoPenguinX2 is not online. ClickNoPenguinX2
Joined: 02 Sep 2013
Total Posts: 23
15 Dec 2015 06:23 PM
Why this script doesn't work on "Play game"? :

function onClicked()
wait(0.1)
script.Intro:Clone().Parent = game.Players.Player.PlayerGui
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

this works in solo mode.
Report Abuse
wonderful72pike is online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
15 Dec 2015 06:25 PM
The test player in Solo Mode is named Player, so you're telling it to clone script.Intro and put it in here:

game
-- Players
---- Player
------ PlayerGui

When you try to do it in "Play Game" (this is called Online mode) that doesn't exist. Instead this does:

game
-- Players
---- ClickNoPenguinX2
Report Abuse
ClickNoPenguinX2 is not online. ClickNoPenguinX2
Joined: 02 Sep 2013
Total Posts: 23
15 Dec 2015 07:13 PM
but I need to all players
Report Abuse
sonicboy01 is not online. sonicboy01
Joined: 22 Nov 2008
Total Posts: 923
15 Dec 2015 07:14 PM
for _, player in pairs (game.Players:GetChildren()) do
--code
end
Report Abuse
wonderful72pike is online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
15 Dec 2015 07:16 PM
That's 100% possible. The MouseClick event of a click detector actually gives you the player that clicked it as a parameter. You can get it in your script like this:


function onClicked(player) -- player = whoever clicked it
wait(0.1)
script.Intro:Clone().Parent = player.PlayerGui -- whoever clicked it gets it
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
ClickNoPenguinX2 is not online. ClickNoPenguinX2
Joined: 02 Sep 2013
Total Posts: 23
15 Dec 2015 07:18 PM
How can I do?
Report Abuse
ClickNoPenguinX2 is not online. ClickNoPenguinX2
Joined: 02 Sep 2013
Total Posts: 23
15 Dec 2015 07:20 PM
ok, thanks, worked
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