Problem with script

Hello everyone, i have problem. The script works every other time. i dont know what to do.
I ask for your help!

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local uperTorso = character:WaitForChild("UpperTorso")
local backPack = game.Workspace:WaitForChild("backpack1")
local backpack1 = backPack:GetChildren()
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")

for i, part in pairs(backpack1) do
	local weld = Instance.new("Weld")
	weld.Part0 = uperTorso
	weld.Part1 = part
	weld.C0 = CFrame.new(0, 0, 1) 
	weld.Parent = backPack


	backPack.Parent = character
end
2 Likes

More description needed please.

Any errors? Tried debugging?

1 Like

Use a weldConstraint instead of a weld. It’s the same thing but improved. Keep everything but remove

And then it should work

1 Like

like this?

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local uperTorso = character:WaitForChild("UpperTorso")
local backPack = game.Workspace:WaitForChild("backpack1")
local backpack1 = backPack:GetChildren()
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")

for i, part in pairs(backpack1) do
	local weld = Instance.new("WeldConstraint")
	weld.Part0 = uperTorso
	weld.Part1 = part
	weld.Parent = backPack

	backPack.Parent = character
end

No, there are no errors. When the player logs in, the script does not work

Yea like that and it should be working.

If it still doesn’t work, write a print statement inside the for loop to see if it actually runs.

If it does print then you probably have to set the position of the backpack first

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.