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