Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Sword seems anchored when i copy it to a players backpack?

So, i have a tool that i try to give myself with a script, the tool is located in replicated. But when i put it in my characters backpack and then equip it,it seems as if the sword is anchored and then teleports me to where the swords position is in studio when not playing. I don't know what i am doing wrong.

This is in a inventory gui btw

local disabled = false
script.Parent.MouseButton1Click:Connect(function()
	local wep = script.Parent.Parent.Parent.Parent.Selected.Value
	for i,v in pairs(script.Parent.Parent.Parent.Parent.Holder:GetChildren()) do
		if v:IsA("ImageButton") then
			if v.ID.Value == wep then
				local togive = game.ReplicatedStorage[v.Name]:Clone()
				local ID = Instance.new("NumberValue",togive)
				ID.Value = v.ID.Value
				ID.Name = "ID"
				togive.Name = v.Name
				for i,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
					if v:FindFirstChild("ID") then
						if v.ID.Value == wep then
							disabled = true
						end
					end
				end
				if disabled == false then
					togive.Parent = game.Players.LocalPlayer.Backpack
				end
			end
		end
	end
	disabled = false
end)

this is the script, i know it's sloppy. And if it is something obvious then please tell me, because i am really missing something here.

2 answers

In your explorer, make sure every part in the tool isn’t anchored. If that doesn’t work, you could iterate through the descendants of the tool and set them to anchored false before parenting.

This discussion is preserved as it was. New answers, comments, and votes are closed.