Trowel Randomly Disappearing?

So, In my game, I have separate tool packs. In the default tool pack, after some time, the trowel randomly disappears.

Nothing but the trowel disappears from the player’s backpack.

I haven’t tried much, which is why I’m coming here as a last resort.
I think it might be something to do with the round module script I have setup, but I’m not sure. The trowel tool is just the classic trowel by Roblox, and all of the scripts in there are fine. But it’s confusing me because the other three tools were fine. If it was the round script breaking, why are the other three tools not getting destroyed?

The other weird part is it always gets deleted when there are 4:37 remaining in the round. Every single time.


Videos:



The ONLY portion of the round script where tools get deleted (which is after the main round countdown, which is why I’m confused if it’s skipping code or not):

for i, player in pairs(Players:GetPlayers()) do
		local character = player.Character

		if not character then
			continue
		else
			if character:FindFirstChild("GameTag") then
				character.GameTag:Destroy()
			end

			for _, tool in pairs(player.Backpack:GetChildren()) do
				if tool:IsA("Tool") then
					tool:Destroy()
				end
			end

			for _, tool in pairs(character:GetChildren()) do
				if tool:IsA("Tool") then
					tool:Destroy()
				end
			end

		end

		player:LoadCharacter()
	end

The entire round module:

local Players = game:GetService("Players")
local replicatedStorage = game:GetService("ReplicatedStorage")
local lighting = game:GetService("Lighting")
local tweenService = game:GetService("TweenService")
local serverStorage = game:GetService("ServerStorage")
local soundService = game:GetService("SoundService")
local marketPlaceService = game:GetService("MarketplaceService")

local musicFolder = soundService:WaitForChild("GameMusic")
local otherSounds = soundService:WaitForChild("OtherSounds")

local maps = serverStorage:WaitForChild("MainGame"):WaitForChild("Maps")

local mainGame = replicatedStorage:WaitForChild("MainGame")
local remotes = mainGame:WaitForChild("Remotes")
local gameValues = mainGame:WaitForChild("GameValues")

local status = gameValues:WaitForChild("Status")

local cashReward = 75
local expReward = 50

local gamepasses = {
	VIP = 123723006
}

local projectileTools = {
	"Time Bomb"
}

local function toMS(s)
	return ("%02i:%02i"):format(s/60%60, s%60)
end

local function unpackageTools(player, pack)
	local clone = pack:Clone()
	
	for _, tool in pairs(clone:GetChildren()) do
		for __, Script in pairs(tool:GetDescendants()) do
			if Script:IsA("Script") and Script.Enabled == false then
				Script.Enabled = true
			end
		end
		
		tool.Parent = player.Backpack
	end

	clone:Destroy()
end

local round = {}

function round.Waiting(numberOfPlayers, minimumPlayers)
	status.Value = minimumPlayers.." ready players are required to start ("..numberOfPlayers.."/"..minimumPlayers.." players)"
end

function round.Intermission(intermissionTime)
	for i=intermissionTime,0,-1 do
		status.Value = "Intermission ("..i..")"
		task.wait(1)
	end

end

function round.StartRound(gameLength)
	status.Value = ""

	local plrs = {}

	for i, player in pairs(Players:GetPlayers()) do
		table.insert(plrs,player)
	end

	task.wait(2)
	
	local availableSongs = soundService:WaitForChild("GameMusic"):GetChildren()
	local chosenSong = availableSongs[math.random(1,#availableSongs)]
	
	local availableMaps = maps:GetChildren()
	local chosenMap = availableMaps[math.random(1,#availableMaps)]

	status.Value = chosenMap.Name.." was selected"

	task.wait(2)

	local newMap = chosenMap:Clone()
	newMap.Name = chosenMap.Name
	newMap.Parent = workspace

	local spawnPoints = newMap:FindFirstChild("SpawnPoints")

	if not spawnPoints then
		warn("Critical Error: There are no spawn points in "..chosenMap.Name.."!")
	end

	local availableSpawns = spawnPoints:GetChildren()

	for i=5,0,-1 do
		status.Value = "Game will start in "..i
		task.wait(1)
	end
	
	remotes:WaitForChild("RoundMusic"):FireAllClients(chosenSong, "On")

	for i, plr in pairs(plrs) do
		if plr then
			local character = plr.Character
			
			coroutine.resume(coroutine.create(function()
				if not character then 
					plr:LoadCharacter()
					wait(0.1)
					character = plr.Character
				end

				wait(1.2)

				character.HumanoidRootPart.Position = availableSpawns[1].Position + Vector3.new(0, 8, 0)
				
				local toolPack = replicatedStorage.MainGame.Tools.WeaponPacks:FindFirstChild(plr.EquippedPack.Value)
				unpackageTools(plr, toolPack)

				local gameTag = Instance.new("BoolValue")
				gameTag.Name = "GameTag"
				gameTag.Parent = character
			end));
		else
			if not plr then
				table.remove(plrs,i)
			end
		end

	end

	wait(1.3)

	for i=gameLength,0,-1 do
		for x, player in pairs(plrs) do
			if player then
				local character = player.Character

				if not character then
					table.remove(plrs,x)
				else
					if character:FindFirstChild("GameTag") then
						--Still in game
						continue
					else
						table.remove(plrs,x)
						
						if player.leaderstats.Level.Value ~= 0 then
							player.leaderstats.Cash.Value += (cashReward + math.floor(cashReward * player.leaderstats.Level.Value / 10) * player.Multiplier.Value)
							player.leaderstats.Level.CurrentExp.Value += (expReward + math.floor(cashReward * player.leaderstats.Level.Value / 10) * player.Multiplier.Value)
						else
							player.leaderstats.Cash.Value += (5 * player.Multiplier.Value)
							player.leaderstats.Level.CurrentExp.Value += (10 * player.Multiplier.Value)
						end
						
						player.leaderstats.Deaths.Value += 1
					end
				end
			else
				table.remove(plrs,x)
			end

		end

		status.Value = "Time: "..toMS(i).." remaining"

		if #plrs == 0 then
			status.Value = "Restarting: No one survived."
			break
		elseif i == 0 then
			status.Value = "Restarting: Time has run out."
			
			for q, ply in pairs(plrs) do
				if ply.leaderstats.Level.Value ~= 0 then
					ply.leaderstats.Cash.Value += (cashReward + math.floor(cashReward * ply.leaderstats.Level.Value / 10) * ply.Multiplier.Value)
					ply.leaderstats.Level.CurrentExp.Value += (expReward + math.floor(cashReward * ply.leaderstats.Level.Value / 10) * ply.Multiplier.Value)
				else
					ply.leaderstats.Cash.Value += (cashReward * ply.Multiplier.Value)
					ply.leaderstats.Level.CurrentExp.Value += (expReward * ply.Multiplier.Value)
				end

				ply.leaderstats.Wins.Value += 1
			end
			
			break
		end

		wait(1)
	end

	wait(1.5)

	for i, player in pairs(Players:GetPlayers()) do
		local character = player.Character

		if not character then
			continue
		else
			if character:FindFirstChild("GameTag") then
				character.GameTag:Destroy()
			end

			for _, tool in pairs(player.Backpack:GetChildren()) do
				if tool:IsA("Tool") then
					tool:Destroy()
				end
			end

			for _, tool in pairs(character:GetChildren()) do
				if tool:IsA("Tool") then
					tool:Destroy()
				end
			end

		end

		player:LoadCharacter()
	end

	table.clear(plrs)
	
	remotes:WaitForChild("RoundMusic"):FireAllClients(chosenSong, "Off")

	status.Value = "Cleaning up map..."

	wait(3)

	newMap:Destroy()

	wait(7)
end

return round

Any help is greatly appreciated!

Best regards,
Amora

Ok so,

Could be the problem, it destroys the clone, I’m not sure if this is the problem, but I don’t know what else it could be, because I’m still new, I’m better at building instead of scripting, so you should ask a programmer, and I had seen you used the Roblox trowel, I know that people doesn’t like when developers use free models, because they think that those developers are lazy (not saying that who uses free models is lazy, I used them too), so I hope you are using it only for testing purposes, because if you keep it people is probably gonna think you are lazy (not saying you are)

I don’t think clone:Destroy() is the issue since it’s destroying the cloned folder and not any of the tools in it. Especially since it’s 23 seconds into the round and the folder gets deleted instantaneously after the tools get cloned into the player’s backpack.


And also, I’ll probably make my own trowel soon, but I might not. I honestly don’t care if people thing I’m lazy lol

Then I don’t know sorry, if you have any more scripts in your game that are part of the round system, have anything to do with the trowel/tools then you should show them, and as already said I’m not a programmer so I’m not the person that you are looking for, but there’s something you could do, add different print(“”) in your scripts and find which one fires closer to when the trowel gets destroyed, this could help you find the problem, have a good day and I hope you solve the problem :smiley:

1 Like

Same thing happening to me where when you touch the weapon you can use it but if you unequipped or equip a different weapon the weapon disappears (it only happens to the weapon not any other item)

sorry for necroposting

For me it doesn’t matter if you equip or unequip it. It still disappears after exactly 23 seconds

Are there any scripts within the tool itself that could be causing this behaviour?

He already showed everything in the post

Nope. Only thing in any of the scripts that destroy things is the function that destroys the parts placed by the trowel, but not the tool itself.