How would I make this script only work on LocalPlayer but still be inside of its part?
local tool = game.ServerStorage.Sword
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr)
local function onTouch(part)
if plr.Backpack:FindFirstChild('Sword') ~= nil then
plr.Backpack:FindFirstChild('Sword'):Remove()
end
end
script.Parent.Touched:connect(onTouch)
end)
end)

2 comments
you could make the script clone a localscript?
You need to reconsider your definition of what the 'LocalPlayer' is in this case