|
| 15 Jul 2013 07:34 PM |
I'm making an elevator, and I want to make it so you can click a panel to open a GUI that lets you change the floors. The problem is, I can't access the Character or Player from that thus I can't access the PlayerGui with the GUI panel in it. How do I access the character (all I need is the character's name) by clicking the button?
~SkateBored, CEO and Founder of Cloud Nine Incorporated. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 07:37 PM |
script.Parent.ClickDetector.MouseClick:connect(function(char) print(char.Name) --code bleughhhh game.Players[char.Name]:remove() --how to get to player end) |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 08:12 PM |
To get a player you should use
game.Players:GetPlayerFromCharacter(character)
Or for this script
script.Parent.ClickDetector.MouseClick:connect(function(clicked)
local char = clicked.Parent
local player = game.Players:GetPlayerFromCharacter(char)
end) |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 08:16 PM |
ClickDetector.MouseClick:connect(function(PlayerWhoClicked) print(PlayerWhoClicked) if PlayerWhoClicked.Character then print("The player that clicked has a character!") print("Killing that character now...") PlayerWhoClicked.Character:BreakJoints() end end) |
|
|
| Report Abuse |
|
|
| |
|