So I have LocalScript that is cloning swords out of the ReplicatedStorage, but when it clones the sword into the players backpack, the sword doesn't work! Is it something wrong with the code?
script.Parent.MouseButton1Click:connect(function() local sword = game.ReplicatedStorage.ClassicSword:Clone() sword.Parent = game.Players.LocalPlayer.Backpack end)
To me, it looks like your script is correct.
If you are using a FREE MODEL: Try to inspect the model for elements/traces of a user-inserted virus. Sometimes, the viruses will prevent scripts from working (just like in versions of Kohls' Admin, it got ruined because so many hackers and virus imputers placed viruses in them, so people switched to LMM. If it's a LinkedSword, it shouldn't take too long to get a new one from the Free Model catalog.
If you made your OWN SWORD: Look through it to make sure all of the parts are alligned. If you made your own sword, it should be working. If you made it yourself and it isn't working, there must be something wrong with a script or somehow a virus got in.
As for your code, it looks perfectly fine. Keep at it, you'll figure it out soon ;)
script.Parent.MouseButton1Click:connect(function() local sword = game.ReplicatedStorage.ClassicSword:Clone() sword.Parent = game.Players.LocalPlayer.Backpack end)