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

Qperfectionweld not working when i put a tool in the players inventory how do i fix?

Asked by 4 years ago
Edited 4 years ago

so whenever i put my lightsaber in the starter pack perfection weld works perfectly but when I clone it from replicated storage then it breaks down and doesn't work here's the code I put inside the button to switch the lightsaber out and whever that happens its just the handle that appears in my hand I'm new to this platform so idk how to get the start and end of the code into the code box sry

function leftclick() local player = game.Players.LocalPlayer local inHand = player.Character:FindFirstChildOfClass('Tool')

01local inBackpack = player.Backpack:FindFirstChildWhichIsA('Tool')
02 
03if inHand then
04 
05    inHand:Destroy()
06 
07end
08 
09if inBackpack then
10 
11    inBackpack:Destroy()
12 
13 
14end
15 
16    local backpack = player:WaitForChild("Backpack")
17    local cloneTool = game.ReplicatedStorage.Bluesaber:Clone()
18    cloneTool.Parent = backpack

end script.Parent.MouseButton1Click:Connect(leftclick)

Answer this question