Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I need a inventory remover script?

Hey so I'm making a parkour game and a level is going to be jumps with a sword. I want it so if you touch a block it removes the sword so you can't cheat and go on to other levels.

1 comment

0

we don’t do requests, we don’t script for you. We only help you on your problems while you script.

2 answers

You can use this:

local part = --Wherever the part is

part.Touched:Connect(function(hit) --When the part is touched, the function fires
	hit.Parent.Backpack.Sword:Destroy() -- Destroys the backpack
end)

1 comment

0

Hey what do you mean by wherever the part is? Do I just have to put the location of the part in?

Revamp of first person's answer

local part = workspace.Part -- you put the part here

-- When touched
part.Touched:Connect(function(Part)
	-- See if has a humanoid (basically player detection)
	if (Part.Parent:FindFirstChild("Humanoid")) then
		-- For every items in the backpack
		for _,v in pairs(Part.Parent.Backpack:GetChildren()) do
			-- Destroy
			v:Destroy()
		end
	end
end)

Also, you shouldn't be requesting for scripts on the site, it's against the rules.

Please accept my answer if it was helpful :)

This discussion is preserved as it was. New answers, comments, and votes are closed.