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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Is there a short version of this?

Previous Thread :: Next Thread 
speedy250 is not online. speedy250
Joined: 16 May 2008
Total Posts: 4783
29 Jul 2011 06:21 PM
A short way to just empty a persons inventory.
Report Abuse
ikilln00bs77 is not online. ikilln00bs77
Joined: 06 Apr 2011
Total Posts: 122
29 Jul 2011 06:32 PM
Put admin in your game

Then say take/all/*NAMEHERE*

No requests
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
29 Jul 2011 06:33 PM
Yeah, I'll include a function so I can demonstrate how.

function onTouch(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil then

-- This is the necessary part. vvvv

for i,v in pairs(game.Players:GetPlayerFromCharacter(hit.Parent).Backpack:GetChildren()) do
if V:IsA("Tool") or v:IsA("Hopperbin") then
v:Remove()

-- This is the necessary part. ^^^

end
end
end
end
script.Parent.Touched:connect(onTouch)

This wouldn't remove any tools that were being used because they are children of the character, therefore you would have to do the same except do
"for i,v in pairs(hit.Parent:GetChildren()) do" instead.
Report Abuse
speedy250 is not online. speedy250
Joined: 16 May 2008
Total Posts: 4783
29 Jul 2011 06:34 PM
@ikillnoobs

itried making one but it was too long
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
29 Jul 2011 06:36 PM
@ikillnoobs

Fail you capitalized a v.
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
29 Jul 2011 06:36 PM
I meant killjoy I just failed there :/
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
29 Jul 2011 06:37 PM
People make mistakes, and my name is killjoy.
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
29 Jul 2011 06:37 PM
@killjoy late post :P
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
29 Jul 2011 06:38 PM
yes.
Report Abuse
Cliff86 is not online. Cliff86
Joined: 01 Mar 2008
Total Posts: 216
29 Jul 2011 06:40 PM
or:

function ot(hit)
if hit.Parent.Humanoid == nil then return end
p = game.Players:getPlayerFromCharacter(hit.Parent)
p.BackPack:remove()
bp = Instance.new("BackPack",p)
end

script.Parent.Touched:connect(ot)
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