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
5 years ago
1local saber = game.ServerStorage.Saber
2saber:Clone()
3local p = game:GetService("Players")
4script.Parent.MouseButton1Click:Connect(function()
5    saber.Parent = p.Backpack
6end)

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 5 years ago
Edited 5 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.

1local player = game:GetService("Players").LocalPlayer
2local saber = game:GetService("ReplicatedStorage"):WaitForChild("Saber")
3 
4script.Parent.MouseButton1Click:connect(function()
5    saber:Clone().Parent = player.Backpack
6end)
Ad

Answer this question