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

How to clone a tool from replicated storage into your starter pack when you click a button? gui

Asked by 3 years ago

hello thanks for looking at this post. so here are the details, how do you make it to when you click a button it removes the current tools that you have in your starter pack then it clones another set from replicated storage. Thanks:)

1 answer

Log in to vote
0
Answered by 3 years ago
--Example with a TextButton:

local button -- type here where the button is
local plr = game:GetService('Players').LocalPlayer

local tool -- type here the tool that you want to replicate when the other tool is deleted

button.Activated:Connect(function()
plr.Backpack:FindFirstChildWhichIsA('Tool'):Destroy()
local clone = tool:Clone()
clone.Parent = plr.Backpack
end)
0
It doesent work and nothing showed up in the output, maybe I put the script in the wrong place isint it supposed to be the child of the textbutton? Iownrobloxp 44 — 3y
0
nevermind I just fixed it, Thanks :) Iownrobloxp 44 — 3y
Ad

Answer this question