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 :)
--Removes all tools from player
local things = Player.Character:GetChildren()
for i=1, #things do
if things[i]:IsA("Tool") then
things[i].Parent = Player.Backpack
end
end
local weapons = Player.Backpack:GetChildren()
for i=1, #weapons do
weapons[i]:Remove()
end
-- places weapon into Character
local clone = script.Parent.ScrollingFrame.Inv2.Weapon.Value:Clone()
clone.Parent = Player.Character
script.Parent.ScrollingFrame.Inv2.BackgroundTransparency = 1

3 comments
Humanoid has a UnequipTools() function.
things[i].Parent.Humanoid:UnequipTools()
I tryed useing the UnequipTools function but it still seems not to work.