It works up until the "sword.Parent = hit.Parent.Backpack" part. Here's the error: Backpack is not a valid member of Model
part = script.Parent
serverstorage = game:GetService("ServerStorage")
part.Touched:connect(function(hit)
part.BrickColor = BrickColor.new("Really red")
local sword = serverstorage:WaitForChild("Sword"):Clone()
sword.Parent = hit.Parent.Backpack
end)

2 comments
I think that it's better to put it in a local script and use Players.LocalPlayer because It doesn't always work with "hit.Parent.Name"...
Thanks!