Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Button clicked tool cloned into backpack?

Asked by 6 years ago

Example -

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

Anyone please, help!

1 answer

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question