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
 

Re: Detect player who clicked?

Previous Thread :: Next Thread 
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
26 Apr 2014 10:47 AM
script.Parent.MouseButton1Click:connect(function()

for i,v in pairs(game.Players:GetChildren()) do

copy = script.Parent.Parent.Parent.Flash:Clone()
wait(0.01)
copy.Parent = v.PlayerGui
wait(0.01)
v.PlayerGui.Flash.FlashEffect.Disabled = false
end
end)

I know I made the problem at :GetChildren, but I'm not sure how to find the direct player who clicked the SurfaceGui button. Any help?
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
26 Apr 2014 10:49 AM
http://wiki.roblox.com/index.php?title=SurfaceGui
Put the SurfaceGui into StarterGui, and then put a script inside it to change it's adornee to the brick you want the Gui to appear on. Then just edit your script accordingly.

Here's my siggy... Done.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
26 Apr 2014 10:49 AM
You detect who clicked a surface gui by having it inside the player (starter gui or whatver) but with the adornee set to whichever brick. This way you can get the player instance by doing script.Parent.Parent or game.Players.LocalPlayer.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
26 Apr 2014 10:52 AM
Wow, that was easy. Thanks.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
26 Apr 2014 10:59 AM
Um...that didn't work?

I put the SurfaceGui in lighting and this localscript in lighting. This is what the localscript does.

script.Parent.EffectGui.Adornee = game.Workspace.Gate.GateOfWorlds.Wheel
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
26 Apr 2014 11:00 AM
Put it in StarterGui, not Lighting, unless you're moving that gui from Lighting to the player's PlayerGui. I'd recommend to just put it in StarterGui.

Here's my siggy... Done.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
26 Apr 2014 11:01 AM
Mistake. It is in Startergui. Still don't know why it won't work...
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
26 Apr 2014 11:03 AM
Did you edit the script accordingly, now that you moved the SurfaceGui to StarterGui (which will go to the player's PlayerGui)?

Here's my siggy... Done.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
26 Apr 2014 11:06 AM
Yeah, that's not the problem. The EffectGui isn't appearing within the Brick as a child....
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
26 Apr 2014 02:51 PM
It wasn't supposed to appear as a child. I get it now. Yet, now I'm unable to edit it through a clickdetector brick. Much difficult ROBLOX...Anything to do about that?
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