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

How do I make a part remove tools onTouch?

(I'm not very good at Lua, but this is not a request)

I'm making a small arena with a tool that people should get once the enter the arena, but when they leave it, the tool should disappear, except I'm having trouble to do this. Please answer my question if you know how.

2 answers

So if you're planning to do this for the player that touches then:

local a = game.StarterPack:GetChildren()
a:Destroy() --it's just the way i do it

Alright, so all you need to do is on the exits of the arena add a part with 0 transparency and no collide. Script for the part -

script.Parent.Touched:connect(function(playerWhoTouched)
        local Player = playerWhoTouched
	local Item = Player.Backpack:FindFirstChild("ItemNameHere") -- Put the Item Name.
	Item:Destroy()
end)


Let me know if it works!

3 comments

0

@oftenz I think the script is not working because of my "giveTool" script.

0

Script: local debounce = false script.Parent.Touched:Connect(function(hit) if hit.Parent.Humanoid then if debounce == true then return end debounce = true plr = game.Players:GetPlayerFromCharacter(hit.Parent) local foundTool = plr.Backpack:FindFirstChild("FencingSword") or plr.Character:FindFirstChild("FencingSword") if not foundTool then local gravity = game.ReplicatedStorage.FencingSword:

0

Script continued: gravity.Parent = plr.Backpack end wait() debounce = false end end)

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