✓ Accepted answer
To do this via a local GUI, you must use the server so that you have the tool for all clients/server.
You will need a localscript, RemoteEvent in replicatedStorage, and a script in serverScriptService.
The localscript should look like this:
local textbox = script.Parent.Parent.TextBox
script.Parent.MouseButton1Click:connect(function()
local toolName = textbox.Text
game.ReplicatedStorage.cloneGear:FireServer(toolName)
end)
This is the server side script
game.ReplicatedStorage.cloneGear.OnServerEvent:Connect(function(plr, toolName)
local tool = plr.Backpack:FindFirstChild(toolName)
if tool ~= nil then
local newTool = tool:Clone()
newTool.Parent = plr.Backpack
end
end)
To change it to search in server storage, change the 2nd line of server side, changing it to
|Location|:FindFirstChild(toolName).
Hope this helps :)
2 comments
Where does the localscript go? I didnt pick that up.
nvm