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
02 | script.Parent.MouseButton 1 Click: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) |
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 |
19 | if disabled = = false then |
20 | togive.Parent = game.Players.LocalPlayer.Backpack |
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.