|
| 05 Oct 2012 09:57 AM |
How would you use game.Players in an Touched function?
example:
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then game.Players.hit.Parent:Destroy() end end)
hit.Parent:Destroy() Will just remove them from the workspace.. game.Players.NameHere:Destroy() Will remove them from the game..
Note: This is not meant to be used to kick players, it was just an example.. The real reason why I'm asking this is so I can do something with Gui's. But I didn't feel like typing a big script.
|
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 05 Oct 2012 10:02 AM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then g = game.Players:findFirstChild(hit.Parent.Name) if g then g:Destroy() end end end)
~A3~ |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2012 10:04 AM |
Awww! I could of thought of that....
Clever one....
Thanks. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 05 Oct 2012 10:19 AM |
| Or you could use the 'GetPlayerFromCharacter' method. Read more about it here, http://wiki.roblox.com/index.php/PlayerFromCharacter_(Function) |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 05 Oct 2012 12:01 PM |
Put this in the part:
script.Parent.Touched:connect(function(hit) hit.Parent:BreakJoints() end) |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 05 Oct 2012 02:36 PM |
He wants to kick them out of the game, not kill them.
~A3~ |
|
|
| Report Abuse |
|
|