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)
3 comments
Nothing seems wrong with the code. Maybe something wrong with the sword itself? Make sure the sword is enabled and that this code is in a localscript...otherwise I have no idea why it's not working.
Make sure the sword you're cloning in functions first. Does it work when placed directly into the starter pack?
Hmm good idead I'll check that xD