Any help would be nice
1 | function onTouch(Hit) |
2 | if Hit.Parent:findFirstChild( "Humanoid" ) ~ = nil then |
3 | game.Players:GetPlayerFromCharacter(Hit.Parent) [ "insert 'package' 's name |
4 | here'" ] :Destroy() |
5 | end |
6 | end |
7 | local sp = script.Parent |
8 | sp.OnTouch:connect(onTouch) |
if you're meaning the player's backpack, try only deleting it's children:
1 | function deleteChildren(instanceClass) |
2 | local children = instanceClass:GetChildren() |
3 | for i = 1 ,#children do |
4 | children [ i ] :Destroy() |
5 | end |
6 | end |
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?