Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I remove someones package when they touch a part? [closed]

Asked by 6 years ago

Any help would be nice

0
what do you mean "package" supermariodeadtolive 55 — 6y
0
is it the player's backpack? supermariodeadtolive 55 — 6y
0
or is it a model in the player's character? supermariodeadtolive 55 — 6y
0
You will be moderated for a nondescriptive question which does not follow the guidelines on this website. User#21908 42 — 6y
0
You don't follow the guidelines tictac67 96 — 6y

Closed as Non-Descriptive by User#21908, AswormeDorijan111, and climethestair

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago
1function onTouch(Hit)
2      if Hit.Parent:findFirstChild("Humanoid")  ~= nil then
3            game.Players:GetPlayerFromCharacter(Hit.Parent)["insert 'package''s name
4here'"]:Destroy()
5      end
6end
7local sp = script.Parent
8sp.OnTouch:connect(onTouch)

if you're meaning the player's backpack, try only deleting it's children:

1function deleteChildren(instanceClass)
2      local children = instanceClass:GetChildren()
3      for i = 1,#children do
4            children[i]:Destroy()
5      end
6end
0
This Is Not A Request Site! supermariodeadtolive 55 — 6y
0
Do not respond to requests which provide no script and no background whatsoever. User#21908 42 — 6y
0
We are not a request/spoon feed site. User#21908 42 — 6y
0
Damn! tictac67 96 — 6y
Ad