Qorm
|
  |
| Joined: 25 Jul 2010 |
| Total Posts: 1650 |
|
| |
|
|
| 02 Jun 2015 05:47 PM |
| Get it from the gui by using parents or localplayer |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 05:51 PM |
| Using it in a local script, it is as easy as sending game.Player.LocalPlayer in a MouseButton1Click event |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 05:52 PM |
I mistyped, its:
game.Players.LocalPlayer -- Forgot the s on Players |
|
|
| Report Abuse |
|
|
Qorm
|
  |
| Joined: 25 Jul 2010 |
| Total Posts: 1650 |
|
|
| 02 Jun 2015 06:03 PM |
sorry, i wasnt being clear enough. what i meant is: ex) button.MouseButton1Click:connect(function(test) if test.Parent.Name==game.LocalPlayer.Name then print"this is what i mean!" end end) |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 06:15 PM |
game.LocalPlayer.Name is invalid. It would be game.Players.LocalPlayer.Name
For you example it would be:
button.MouseButton1Click:connect(function(test) if test.Parent.Name==game.LocalPlayer.Name then print"this is what i mean!" end end)
However, this still may not be what you want. The MouseButton1Click does not send any arguments. It merely tells when it has been clicked. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 06:16 PM |
@earthy
FAIL
"game.LocalPlayer.Name" |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 Jun 2015 06:17 PM |
You don't have to. Your player is already defined by LocalPlayer
local player = game.Players.LocalPlayer
gui.MouseButton1Click:connect(function() print(player.Name) end) |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 06:24 PM |
@iSpec
lol, didn't notice XD
Copy and pasted his code and forgot to edit it. Got distracted by my chicken I was eating. Sorry about that. :) |
|
|
| Report Abuse |
|
|