it does not work can someone help me?
function onClicked()
pistol = game.Lighting["Cheezburger"]:clone()
pistol.Parent = player.Backpack
end
script.Parent.MouseButton1Click:connect(onClicked)
it does not work can someone help me?
function onClicked()
pistol = game.Lighting["Cheezburger"]:clone()
pistol.Parent = player.Backpack
end
script.Parent.MouseButton1Click:connect(onClicked)
You never defined player. I also advise against storing objects in Lighting; the object should go in ReplicatedStorage since the client is accessing it.
local player=game.Players.LocalPlayer
local pistol=game.ReplicatedStorage.Cheezburger
script.Parent.MouseButton1Click:connect(function()
pistol:Clone().Parent=player.Backpack
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.