So I have this GUI in my game and it's supposed to give you a sword every time you click it. I have the script, but it doesn't work and I don't know what to do about it. Any suggestions? (I'm a beginner)
Here is the code:
sword = game.Lighting.Sword:Clone()
script.Parent.MouseButton1Down:connect(function()
local Players = game.Players:GetChildren()
sword.Parent = game.Players.LocalPlayer.Backpack
end)

1 comment
is this a localscript or a script, and where is it located