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.
COMMUNITY QUESTION
I need a inventory remover 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.

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