I've tried applying the fix posted here but I still can't get it to work. I have one weapon from the Weapons Kit in my game. I've moved the WeaponsSystem folder to ReplicatedStorage as recommended here . When the game starts, my weapon disappears after a couple seconds.
I've removed the conditional on line 60 of ServerWeaponsScript and I also commented out anything that references curWeaponsSystemFolder. Can't get it to work. I posted my changes below, including all the lines I commented out.
-- local curWeaponsSystemFolder = script.Parent
--if weaponsSystemFolder == nil then
-- weaponsSystemFolder = curWeaponsSystemFolder:Clone()
-- initializeWeaponsSystemAssets()
-- weaponsSystemFolder.Parent = ReplicatedStorage
--end
--if ServerScriptService:FindFirstChild("ServerWeaponsScript") == nil then
script.Parent = ServerScriptService
initializeWeaponsSystemAssets()
local WeaponsSystem = require(weaponsSystemFolder.WeaponsSystem)
if not WeaponsSystem.doingSetup and not WeaponsSystem.didSetup then
WeaponsSystem.setup()
end
local function setupClientWeaponsScript(player)
local clientWeaponsScript = player.PlayerGui:FindFirstChild("ClientWeaponsScript")
if clientWeaponsScript == nil then
clientWeaponsScript = weaponsSystemFolder.ClientWeaponsScript:Clone()
clientWeaponsScript.Parent = player.PlayerGui
end
end
Players.PlayerAdded:Connect(function(player)
setupClientWeaponsScript(player)
end)
for _, player in ipairs(Players:GetPlayers()) do
setupClientWeaponsScript(player)
end
--end
--if curWeaponsSystemFolder.Name == "WeaponsSystem" then
-- curWeaponsSystemFolder:Destroy()
--end