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

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

Asked by
seikkatsu 110
4 years ago
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

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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)
Ad

Answer this question