generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

game.Players.hit.Parent..

Previous Thread :: Next Thread 
Oranganal is not online. Oranganal
Joined: 29 Aug 2012
Total Posts: 3
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 is not online. 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
Oranganal is not online. Oranganal
Joined: 29 Aug 2012
Total Posts: 3
05 Oct 2012 10:04 AM
Awww! I could of thought of that....


Clever one....

Thanks.
Report Abuse
Desperian is not online. 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 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
05 Oct 2012 10:55 AM
No problem.

~A3~
Report Abuse
Fedorakid is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image