1 | local saber = game.ServerStorage.Saber |
2 | saber:Clone() |
3 | local p = game:GetService( "Players" ) |
4 | script.Parent.MouseButton 1 Click:Connect( function () |
5 | saber.Parent = p.Backpack |
6 | end ) |
here's the script i don't know what is wrong at line 5 any help would be apriciated
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.
1 | local player = game:GetService( "Players" ).LocalPlayer |
2 | local saber = game:GetService( "ReplicatedStorage" ):WaitForChild( "Saber" ) |
3 |
4 | script.Parent.MouseButton 1 Click:connect( function () |
5 | saber:Clone().Parent = player.Backpack |
6 | end ) |