ToggleMic not working correctly

  1. What do you want to achieve?
    When I do !ToggleMic (username), I want it to show a notification saying my mic is enabled, same with when ever I disabled it, when ever it is enabled I would like for whatever I say in chat to pop up in a notification until I disable it.

  2. What is the issue?
    For some reason it is just buggy all over the place, when I set someone elses Mic on it they can tlak perfectly fine, but I can still talk also. And if I enable someone elses Mic, and then alsop enable mine it would say mine is disabled.

Explorer
image

One of the Errors I get when I disable my mic

Local script in StarterGui

local MicStatus = false

game.ReplicatedStorage.MicToggleNotificationEvent.OnClientEvent:Connect(function(Target, player)
	
	if MicStatus == false then
		
		game.StarterGui:SetCore("SendNotification", {

			Title = "Toggle Mic";
			Text = Target.Name.."'s Mic is on";
			Icon = "http://www.roblox.com/asset/?id=257119670";
			Duration = "10"

		})
		print(Target.Name)
		MicStatus = true
		
	elseif MicStatus == true then
		
		game.StarterGui:SetCore("SendNotification", {

			Title = "Toggle Mic";
			Text = Target.Name.."'s Mic is off";
			Icon = "http://www.roblox.com/asset/?id=6853258454";
			Duration = "10"

		})
		print(Target.Name)
		Target = ""
		MicStatus = false
		print(Target.Name)
		
	end
	
	Target.Chatted:Connect(function(msg)
		
		if MicStatus == true and player.Name == Target.Name then
				
			game.StarterGui:SetCore("SendNotification", {

				Title = Target.Name;
				Text = msg;
				Button = "Read"

			})
				
			print(Target.Name)
			
		end
		
	end)
	
end)

Command Handler Script

--// VARIABLES \\--

local Players = game:GetService("Players")

local Prefix = '!'


--// FUNCTIONS \\--

local function CheckForTarget (Target)
	
	if not Target then
		return false
		
	else
		return true
	end
	
end

Players.PlayerAdded:Connect(function(player)
	
	if player:GetRankInGroup(5910800) >= 253 or player.Name == "SteveoAttano" or player.Name == "aaaaaawfsdg" then
	
		player.Chatted:Connect(function(msg)
			
			if msg:sub(1,11) == Prefix.."ToggleMic " then
				
				local Target = Players:FindFirstChild(msg:sub(12))
				local Valid = CheckForTarget(Target)
				
				if Valid then
					
					game.ReplicatedStorage.MicToggleNotificationEvent:FireAllClients(Target, player)
					
				end
				
			end
			
		end)
		
	end
	
end)