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
I am a beginner scripter and don't know much, but this might help
local tool = game.Parent local player = game.Players.LocalPlayer script.Parent.ClickDetector:Connect(function(player) tool.Clone = Instance.new(tool, game.StarterPack) end)