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

how can i clone a tool from the server storage to the players bp?

local saber = game.ServerStorage.Saber
saber:Clone()
local p = game:GetService("Players")
script.Parent.MouseButton1Click:Connect(function()
	saber.Parent = p.Backpack
end)

here's the script i don't know what is wrong at line 5 any help would be apriciated

1 answer

✓ Accepted answer

You should put the Saber into ReplicatedStorage and make the script a local script. You also didn't get the player who clicked the button so your script is finding Backpack in game.Players

This should work.

local player = game:GetService("Players").LocalPlayer 
local saber = game:GetService("ReplicatedStorage"):WaitForChild("Saber")

script.Parent.MouseButton1Click:connect(function()
	saber:Clone().Parent = player.Backpack
end)

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