MF is the name of the part and Heal is the sword but somethings wrong. I didn't write this script but I think that Player should be a variable. I tried doing local.Players.LocalPlayer and it still didn't work.
local block = game.Workspace.MF
local sword = game.ReplicatedStorage.Heal
--edit the below values
local DistanceNumber = -96.25 --distance from center of part where it will delete the sword
local SwordName = "Heal" --name of the sword to be deleted
local Player = game.Players.LocalPlayer
block.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChildWhichIsA("Tool") and
game.Players[hit.Parent.Name].Backpack:FindFirstChild(sword.Name) then
local Character = hit.Parent
sword:Clone().Parent = Character
print(sword.Name .. " gave to " .. Character.Name)
local magnitude = (Player.Character.PrimaryPart.Position - script.Parent.Position).magnitude
while magnitude < DistanceNumber do
magnitude = (Player.Character.PrimaryPart.Position -script.Parent.Position).magnitude
wait(0.1)
end
Player.Character[SwordName]:Destroy()
print(SwordName .. "removed from " .. Character.Name)
end
end)