Player dos not hold tool after it is equipped for a 2nd time. How can I fix this?
Hi, Am trying to make an inventory gui with button to activate different weapons. Basically when a player presses the button, the weapon in ReplicatedStorage is cloned and placed into the Player's Character. This only works once. When the player presses the next button it removes all tools it has and then clones and places the next identical weapon inside him, but this dos not work anymore(even if I reset). When I try to equip the weapon again, it is placed into the character, but it appears in the middle of the map and falls through until it is destroyed. Below is some of the code inside the inventory gui when the button is pressed. If anyone has had this problem or have any suggestions, I would appreciate the help :)
02 | local things = Player.Character:GetChildren() |
04 | if things [ i ] :IsA( "Tool" ) then |
05 | things [ i ] .Parent = Player.Backpack |
08 | local weapons = Player.Backpack:GetChildren() |
14 | local clone = script.Parent.ScrollingFrame.Inv 2. Weapon.Value:Clone() |
15 | clone.Parent = Player.Character |
16 | script.Parent.ScrollingFrame.Inv 2. BackgroundTransparency = 1 |