I'm making a strategy game and you find a gun in one part, once you click it, you get it. But It won't work.
script.Parent.ClickDetector.MouseClick:connect(function() game.Lighting.Pistol:Clone().Parent = Backpack script.Parent:Destroy() end)
Thank you for the help!
This script is meant to be a child of the ClickDetector.
Pistol = game.Lighting.Pistol script.Parent.MouseClick:connect(function(player) if player.Backpack:FindFirstChild("Pistol") == nil then x = Pistol:Clone() x.Parent = player.Backpack script.Parent.Parent:Destroy() end end)
Hope this is what your looking for.