I was wondering how to make a script where if you touch a brick with a certain gear in your hand it will turn into a different gear that is from Lighting or Server Storage.I need it to be a certain tool that is in there backpack. Such as you have to have a linked sword in your inventory and hold it while you touch the brick and you will get a venom shank and nothing else works but the linked sword.I want the linked sword to disappear from the inventory but only a linked sword nothing else and a venomshank to appear and it to be forced equipped.
✓ ANSWER ACCEPTED
Tool Changer Script?
1 answer
✓ Accepted answer
local Part = script.Parent -- This script will be in this Part, which will be touched to give the tool.
local Storage = game:GetService("ServerStorage") -- Change it to wherever the tools are stored.
local ToolName = "Gain" -- Name of the Tool that will be in the Storage
local BackpackToolname == "Loss" -- Name of the Tool that will be 'transformed' into a new one.
local Tool = Storage:WaitForChild(ToolName) -- The actual tool. If it doesn't exist, it stops here to wait until it does.
local Active = false -- A value that will be used to check whether it is active or not, to keep from getting multiple Gains and losing multiple Losses.
Part.Touched:connect(function(Hit) -- Hit will be whatever touched the Part, that will be checked
if Active == true then return end -- If it really is already checking, then stop letting other events waste its time.
Active = true -- If not, then it sets itself to true, and false when it's done.
if Hit and Hit.Parent then -- If the Hit object still exists, because there are things like bullets that disappear on impact.
if game.Players:GetPlayerFromCharacter(Hit.Parent) then-- If the Hit belongs to the Player's character, then...
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) -- Easier referral.
local Backpack = Player:WaitForChild("Backpack") -- Waiting to load the storage of the player's tools, though not including the one he/she is already holding.
if Backpack:FindFirstChild(BackpackToolname) then -- If the backpack DOES have a tool named Loss, then...
local ToRemove = Backpack:FindFirstChild(BackpackToolname)
ToRemove:remove() -- Destroy the Tool that is in the Backpack.
Tool:clone().Parent = Backpack -- Clone the new Storage tool and put it into that person's gears.
end)
Due note, this is not a site to request people to make scripts for you, it's an educational site for others to help fix what you have broken in your script. The above code will, when in a Part, activate and do what you have asked for.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
The furthest I have got is local tool = game.ServerStorage.UsefulToolYouMightUse MyParent = script.Parent MyParent.Touched:connect(function(player) MyParent:Remove() Workspace.player.Humanoid:EquipTool(tool) end)