Fix to a spawner bug using messages?

So I have created this script that should spawn you a gun when you type /sg akdrum but its not working right now, and the error message I created pops up when you type an emote, /e. As seen here https://gyazo.com/f30e77e0cdeb675776a1809363c38f2f so I am not sure why its doing this, any help?

function onChatted(message, player)
    if message == "/sg akdrum" and game.MarketplaceService:UserOwnsGamePassAsync(player.UserId, 6110582) and player.leaderstats.LimitAK.Value > 0  then
     game.ReplicatedStorage.Firearms.AkDrum:Clone().Parent = player.Backpack
player.leaderstats.LimitAK.Value = player.leaderstats.LimitAK.Value - 1
player.PlayerGui.SpawnerViews.Spawner.Enabled = true
player.PlayerGui.SpawnerViews.Spawner.TextLabel.Text = "You have ".. player.leaderstats.LimitAK.Value.."/15 guns left to spawn!" 
wait(2)
player.PlayerGui.SpawnerViews.Spawner.Enabled = false
elseif player.leaderstats.LimitAK.Value == 0 then
player.PlayerGui.SpawnerViews.Spawner2.Enabled = true
player.PlayerGui.SpawnerViews.Spawner2.TextLabel.Text = "You have no guns left to spawn"
wait(2)
player.PlayerGui.SpawnerViews.Spawner2.Enabled = false
end
end
game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(message) onChatted(message, player) 
	end)

end)

The /e problem happens because of your if else statement. If anything is typed that isn’t the “/sg akdrum” then it immediately stops evaluating that if and moves onto to the elseif. The elseif doesn’t check what they typed however, so it just checks their limit. To fix that problem just shuffle the if statement a bit.

function onChatted(message, player)
    if message == "/sg akdrum" and game.MarketplaceService:UserOwnsGamePassAsync(player.UserId, 6110582) then
	    if player.leaderstats.LimitAK.Value > 0 then
			game.ReplicatedStorage.Firearms.AkDrum:Clone().Parent = player.Backpack
			player.leaderstats.LimitAK.Value = player.leaderstats.LimitAK.Value - 1
			player.PlayerGui.SpawnerViews.Spawner.Enabled = true
			player.PlayerGui.SpawnerViews.Spawner.TextLabel.Text = "You have ".. player.leaderstats.LimitAK.Value.."/15 guns left to spawn!"
			wait(2)
			player.PlayerGui.SpawnerViews.Spawner.Enabled = false
			
		elseif player.leaderstats.LimitAK.Value == 0 then
			player.PlayerGui.SpawnerViews.Spawner2.Enabled = true
			player.PlayerGui.SpawnerViews.Spawner2.TextLabel.Text = "You have no guns left to spawn"
			wait(2)
			player.PlayerGui.SpawnerViews.Spawner2.Enabled = false
		end
	end
end

game.Players.PlayerAdded:connect(function(player)
    	player.Chatted:connect(function(message) onChatted(message, player) 
	end)
end)