Script adding multiple clones after a few attempts

  1. Make a clone every one click.

  2. It clones multiple times when you open it a few times, you click it once and it won’t tween down so then you press it again, it tweens but makes two clones.

  3. Tried adding a cooldown.

	plr.CharacterAdded:Connect(function(char)

	local newvalue = Instance.new("StringValue")
	newvalue.Parent = char
end)

		game.ReplicatedStorage.Callsign.OnServerEvent:Connect(function(player,text)
			print(text)
			player.Character.Value.Value = text
		for i,v in pairs(game.Players:GetChildren()) do
			if v:IsA("Player") then
					if v.PlayerGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name) then print("callsignevent") end
					local clone = v.PlayerGui.Radio.Units.ScrollingFrame.Template:Clone()
					clone.Parent = v.PlayerGui.Radio.Units.ScrollingFrame
					clone.Visible = true
					clone.TextLabel.Text = player.Character.Value.Value..":"..player.Name
					local team = player.Team.Name
				local image = v.PlayerGui.Radio.Units.ScrollingFrame
				clone.Name = player.Name
				local modulescript = require(game.ReplicatedStorage.RadioConfig)
				if player.Team.Name == modulescript.policeteamname then
					clone.ImageLabel.Image = modulescript.Police
				end
				if player.Team.Name == modulescript.fireteamname then
					clone.ImageLabel.Image = modulescript.Fire
				end
				
					wait(10)
					local Players = game:GetService("Players")

					Players.PlayerRemoving:Connect(function(player)
						for i,v in pairs(game.Players:GetChildren()) do
							if game.StarterGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name) then
								if v:IsA("Player") then
									v.PlayerGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name):Destroy()
								end
			end
			end
					end)
				end
			end
			end


	)
end)


				




				

	














local debounce = false
local players = game:GetService("Players")
local replicated = game:GetService("ReplicatedStorage")

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local newvalue = Instance.new("StringValue")
		newvalue.Parent = character
	end)
end)

players.PlayerRemoving:Connect(function(player)
	for i,v in pairs(players:GetPlayers()) do
		if player.PlayerGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name) then
			if v:IsA("Player") then
				v.PlayerGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name):Destroy()
			end
		end
	end
end)

replicated.Callsign.OnServerEvent:Connect(function(player, text)
	print(text)
	player.Character.Value.Value = text
	for i,v in pairs(players:GetPlayers()) do
		if v:IsA("Player") then
			
			if debounce then
				return
			end
			
			debounce = true
			
			if v.PlayerGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name) then
				print("callsignevent")
			end
			
			local clone = v.PlayerGui.Radio.Units.ScrollingFrame.Template:Clone()
			clone.Parent = v.PlayerGui.Radio.Units.ScrollingFrame
			clone.Visible = true
			clone.TextLabel.Text = player.Character.Value.Value..":"..player.Name
			local team = player.Team.Name
			local image = v.PlayerGui.Radio.Units.ScrollingFrame
			clone.Name = player.Name
			local modulescript = require(replicated.RadioConfig)
			
			if player.Team.Name == modulescript.policeteamname then
				clone.ImageLabel.Image = modulescript.Police
			end
			
			if player.Team.Name == modulescript.fireteamname then
				clone.ImageLabel.Image = modulescript.Fire
			end
			
			task.wait(10)
			debounce = false
		end
	end
end)
if game.StarterGui.Radio.Units.ScrollingFrame:FindFirstChild(player.Name) then