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

Button clicked tool cloned into backpack?

Example -

When a Button is clicked, it gets the specific tool, from Lighting!

Anyone please, help!

1 answer

Assuming you already have a button and gui put the following into a local script:

local button = script.Parent
local weapon = game.Lighting["WEAPON NAME HERE"]
local plr = game.Players.LocalPlayer

button.MouseButton1Down:connect(function()
	local cw = weapon:Clone
	cw.Parent = plr.BackPack
end)

Your code should look something like this I'm not on my computer so there is probably some sort of error but you should be able to figure that out good luck on your game.

This discussion is preserved as it was. New answers, comments, and votes are closed.