iKyler
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 2712 |
|
|
| 28 Jun 2012 09:10 PM |
Title. I've seen in scripts that people use "playerWhoClicked". |
|
|
| Report Abuse |
|
|
dddylan98
|
  |
| Joined: 16 Jul 2008 |
| Total Posts: 1497 |
|
|
| 28 Jun 2012 09:11 PM |
| I might be wrong but I don't think you can that easily... |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2012 09:14 PM |
script.Parent.ClickDetector.MouseClick:connect(function(player) --Stuff end) |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 28 Jun 2012 09:15 PM |
Workspace.Part.ClickDetector.MouseClick:connect(function(playerWhoClicked) print("Part was clicked by: " .. playerWhoClicked.Name) end)
http://wiki.roblox.com/index.php/MouseClick |
|
|
| Report Abuse |
|
|
iKyler
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 2712 |
|
|
| 28 Jun 2012 09:23 PM |
| So I have to use an anonymous function to do it? |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2012 09:25 PM |
where Usually You see
function onClick()
end
do
function onClick(player)
end
Where "player" is game.Players.PlayerThatClickedTheButton |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 28 Jun 2012 09:28 PM |
It can be either;
function yo(playerWhoClicked) print("Part was clicked by: " .. playerWhoClicked.Name) end game.Workspace.Part.ClickDetector.MouseClick:connect(yo)
or
Workspace.Part.ClickDetector.MouseClick:connect(function(playerWhoClicked) print("Part was clicked by: " .. playerWhoClicked.Name) end) |
|
|
| Report Abuse |
|
|
iKyler
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 2712 |
|
|
| 28 Jun 2012 09:30 PM |
| Thanks for the explaination. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2012 09:54 PM |
Hurray for concatenation!
~"If I win the lottery, the first thing I'm buying is an optical mouse"~ |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 28 Jun 2012 09:56 PM |
| I might need this later on :O |
|
|
| Report Abuse |
|
|