Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

i was just wondering if its possible to add and remove tools by touching a part. Its cuz i am making a mini-game game and i want to remove and add tools by touching a part/block.

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

Ad
Log in to vote
0
Answered by 4 years ago

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.

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. AWE2007WE 0 — 4y
0
And thx for the script :) AWE2007WE 0 — 4y

Answer this question