hi there im working on an fps game and made this script for the weapon loadout menu but it dose not seem to work properly
script.Parent.Parent.HK416_Button.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local tool = game.ReplicatedStorage.HK416:Clone()
tool.Parent = player.Backpack
script.Parent.Parent.Parent.Parent.SelectionGui.Enabled = false
end)
it gives the player the gun and closes the UI. but when the player equips the gun the scripts inside the gun does not work

2 comments
The problem is inside your gun script, not inside your tool giver.
the gun works fine when i put it on starter pack and play-test the game