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

How can i add and remove tools by touching a block?

2 answers

I am making a mini-game game and i want to add and remove when they spawn (just making an invisible part

To remove tools put this script inside of the part.

function hit(part)
	if hit == nil then return end
	h = game.Players:GetPlayerFromCharacter(part.Parent)
	if h ~= nil then
		c = h.Backpack:GetChildren()
		for i=1,#c do
			c[i]:remove()
		end
	end
end

script.Parent.Touched:connect(hit)

If you'd like to add tools on touch use a free model. There's one named create your own giver.

2 comments

0

In ServerStorage i have a tool. Can i specifically add and remove that when the player touches a part? And can i do it with multiple tools.

0

And thx for the script :)

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