ok so everytime i go in game to test, it constantly says attempt to index and all that, never works - it's for a shop GUI that gives you a gun when clicked
script.Parent.MouseButton1Click:Connect(function() local RS = game:GetService("ReplicatedStorage") local item = RS:WaitForChild("GlockDrum") local player = game.Players.LocalPlayer local cloned = item:Clone() cloned.Parent = player.Backpack end)
If this is a script then localplayer will not work. How you could fix this is by passing a plr argument in the Mouse click event "script.Parent.MouseButton1Click:Connect(function(player)" and then removing the local player variable.
Hope this helps!