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 5 years ago

Any help would be nice

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

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 5 years ago
Edited 5 years ago
function onTouch(Hit)
      if Hit.Parent:findFirstChild("Humanoid")  ~= nil then
            game.Players:GetPlayerFromCharacter(Hit.Parent)["insert 'package''s name 
here'"]:Destroy()
      end
end
local sp = script.Parent
sp.OnTouch:connect(onTouch)

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

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