Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gui tool giver Help?

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)

1 answer

✓ Accepted answer

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.