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: Getting plr from SurfaceGui Click.

Previous Thread :: Next Thread 
SkyDoesMinecraft is online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
18 Dec 2013 04:18 PM
So heres my question, How would I get a players name if they clicked a surfacegui button.

I've tryed this script before and it didn't work it said my player variable was a number value script: script.Parent.MouseButton1Down:connect(function(v) if v.Name=="Player1" then print("gg") else print("no gg") end end) So yea.. So if any body could help me with this plase leave a script example because i'm clueless on how to do this.

No i am not askinf you to make a script for me, I just need help on how to get the plr froma SurfaceGui click. ( There is no wiki articals about surface guis yet )
Report Abuse
Quorum is not online. Quorum
Joined: 25 Oct 2013
Total Posts: 4680
18 Dec 2013 04:29 PM
I'm simply going to post what's already in an extremely red box on the ROBLOX Wiki.

"Note: SurfaceGuis must be descendants of PlayerGui in order to know the player who is interacting with it."

If your SurfaceGui is a descendant of a player's PlayerGui, you can simply parent up to their player, or if you're using a LocalScript "game.Players.LocalPlayer".

Report Abuse
SkyDoesMinecraft is online. SkyDoesMinecraft
Joined: 15 Jul 2012
Total Posts: 656
19 Dec 2013 02:44 PM
So would i make the surface guis Adornee the part i want it to be on and it's parent in the players playergui?
Report Abuse
crazyman32 is online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
19 Dec 2013 02:49 PM
Just set the Adornee via a script.

For instance, let's say the SurfaceGui is in the PlayerGui. Then a LocalScript/Script is in the SurfaceGui that has the following code:


script.Parent.Adornee = game.Workspace.SOME_PART
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