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

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

Asked by
I_Nev 200 Moderation Voter
5 years ago

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

01local disabled = false
02script.Parent.MouseButton1Click:Connect(function()
03    local wep = script.Parent.Parent.Parent.Parent.Selected.Value
04    for i,v in pairs(script.Parent.Parent.Parent.Parent.Holder:GetChildren()) do
05        if v:IsA("ImageButton") then
06            if v.ID.Value == wep then
07                local togive = game.ReplicatedStorage[v.Name]:Clone()
08                local ID = Instance.new("NumberValue",togive)
09                ID.Value = v.ID.Value
10                ID.Name = "ID"
11                togive.Name = v.Name
12                for i,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
13                    if v:FindFirstChild("ID") then
14                        if v.ID.Value == wep then
15                            disabled = true
View all 26 lines...

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

Log in to vote
1
Answered by 5 years ago

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.

Ad
Log in to vote
-1
Answered by 5 years ago

There could be a weld in your Handle, delete it.

0
Why? RunKittenzRComin 170 — 5y

Answer this question